Skip to content

Commit

Permalink
Refs #950 cleaned the following for toolbar pattern:
Browse files Browse the repository at this point in the history
- moveViewsToSubset now has a clearer condition name for the moving
  of the view to the subset
- run the hideElements action when clicking on the toobar logo to
  expand the toolbar. If it needs to resize it will, otherwise nothing
  will happen
  • Loading branch information
ichim-david committed Sep 14, 2015
1 parent 0784695 commit a149083
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Products/CMFPlone/static/patterns/toolbar/src/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ define([
$('body').addClass(that.options.classNames.topExpanded);
$('body').removeClass(that.options.classNames.topDefault);
}
that.hideElements();
}
});

Expand Down Expand Up @@ -218,7 +219,8 @@ define([
},
moveViewsToSubset: function($container, $views, $subset) {
var i, $content_view, length = $views.length - 1;
if ($container.offset().top !== 0) {
var view_should_move = $container.offset().top !== 0;
if (view_should_move) {
for (i = length; length >= 0; length -= 1) {
$content_view = $views.eq(i);
$content_view.hide().clone(true, true).appendTo($subset).show();
Expand Down Expand Up @@ -276,6 +278,8 @@ define([
$('#plone-toolbar-more-subset').remove();
$plone_toolbar_main.children().show();
}
// check if the personal toolbar is not offseted if there isn't enough space
// and we already have the plone-toolbar-more-options added to the page.
if ($pers_bar_container.offset().top !== 0) {
that.moveViewsToSubset($pers_bar_container, $content_views, $("#plone-toolbar-more-subset"));
}
Expand Down

0 comments on commit a149083

Please sign in to comment.