Skip to content

Commit

Permalink
Refs #950; fixed the following toolbar issues:
Browse files Browse the repository at this point in the history
- Menus are now closed when switching from expanded to contracted
  and back
- Clicking the personal bar link now closes the subset menu as well
- Fixed the position of the subset menus when collapsed by removing
  the hardcoded value of 105px from toolbar.plone.less
  • Loading branch information
ichim-david committed Sep 16, 2015
1 parent e03c013 commit d8cce35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,10 @@ body.userrole-authenticated {
overflow-y: auto;
height: 0;
}
#plone-toolbar-more-subset > li ul {
top: 105px;
}
nav > ul li.active ul {
height: inherit;
max-height: 1000px; // trick to activate transition
top: auto;
}
li.active > a:after {
border-bottom: 10px solid #2a2a2a;
Expand Down
12 changes: 9 additions & 3 deletions Products/CMFPlone/static/patterns/toolbar/src/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ define([
$('body').addClass(that.options.classNames.topExpanded);
$('body').removeClass(that.options.classNames.topDefault);
}
that.hideElements();
}
that.hideElements();
});

$('nav > ul > li li', that.$container).off('click').on('click', function(event) {
Expand All @@ -128,7 +128,10 @@ define([
}
else {
// close existing opened contentmenus
$('nav li', that.$container).removeClass(active_class);
$('.' + active_class, that.$container).removeClass(active_class);
// we need to close the more subset as well not just the content-menus
// when we click on the personal bar
$("#plone-toolbar-more-subset").hide();
}
$('nav li > ul', $(this)).css({'margin-top': ''}); // unset this so we get fly-in affect
if (!hasClass) {
Expand Down Expand Up @@ -290,8 +293,11 @@ define([
});

that.moveViewsToSubset($pers_bar_container, $content_views, $toolbar_more_subset);

var active_class = that.options.classNames.active;
$toolbar_more_options.find('a').on('click', function(event){
// close existing opened contentmenus
$('.' + active_class, that.$container).removeClass(active_class);

var $more_list = $(this).parent();
// properly toggle active class for toolbar_more list item
$more_list.toggleClass('active', $toolbar_more_subset.is(":hidden"));
Expand Down

0 comments on commit d8cce35

Please sign in to comment.