Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit 6dacbb9

Browse files
committed
Merge branch 'fdelayen-master' into development
2 parents ac8979a + e3ae4ab commit 6dacbb9

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ If this is true, we'll move the list items back to where they were before, and r
8181
(boolean, defaults to 'true')
8282
Should we absolutely position the popup? Usually this is a good idea. That way, the popup can appear over other content and spill outside a parent that has overflow: hidden set. If you want to do something different from this in CSS, just set this option to false.
8383

84+
###popupClass
85+
(string, defaults to '')
86+
If this is set, this class will be added to the popup
87+
8488
##License
8589

8690
flexMenu is licensesed under the MIT License, and is free for commercial or personal use.

flexmenu.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
'linkTitleAll' : 'Open/Close Menu', // [string] If we hit the cutoff, what should the title of the "view more" button be?
4747
'showOnHover' : true, // [boolean] Should we we show the menu on hover? If not, we'll require a click. If we're on a touch device - or if Modernizr is not available - we'll ignore this setting and only show the menu on click. The reason for this is that touch devices emulate hover events in unpredictable ways, causing some taps to do nothing.
4848
'popupAbsolute' : true, // [boolean] Should we absolutely position the popup? Usually this is a good idea. That way, the popup can appear over other content and spill outside a parent that has overflow: hidden set. If you want to do something different from this in CSS, just set this option to false.
49+
'popupClass' : '', // [string] If this is set, this class will be added to the popup
4950
'undo' : false // [boolean] Move the list items back to where they were before, and remove the "View More" link.
5051
}, options);
5152
this.options = s; // Set options on object
@@ -81,7 +82,9 @@
8182
var $popup = $('<ul class="flexMenu-popup" style="display:none;' + ((s.popupAbsolute) ? ' position: absolute;' : '') + '"></ul>'),
8283
// Move all list items after the first to this new popup ul
8384
firstItemOffset = $firstItem.offset().top;
84-
for (i = numItems; i > 1; i--) {
85+
// Add class if popupClass option is set
86+
$popup.addClass(s.popupClass);
87+
for (i = numItems; i > 1; i--) {
8588
// Find all of the list items that have been pushed below the first item. Put those items into the popup menu. Put one additional item into the popup menu to cover situations where the last item is shorter than the "more" text.
8689
$lastChild = $this.find('> li:last-child');
8790
keepLooking = (needsMenu($lastChild));

0 commit comments

Comments
 (0)