From: Kevin Ball Date: Thu, 2 Feb 2017 21:06:16 +0000 (-0800) Subject: Merge pull request #9622 from zurb/responsive-toggle-targeting-bug X-Git-Tag: v6.3.1-rc1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b6b6a1971d95bdb59046492c94c20e15eb5363f;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Merge pull request #9622 from zurb/responsive-toggle-targeting-bug Fix responsive toggle to pay attention to targets of internal toggles --- diff --git a/js/foundation.responsiveToggle.js b/js/foundation.responsiveToggle.js index 8f107e1d4..6cb360856 100644 --- a/js/foundation.responsiveToggle.js +++ b/js/foundation.responsiveToggle.js @@ -38,7 +38,10 @@ class ResponsiveToggle { } this.$targetMenu = $(`#${targetID}`); - this.$toggler = this.$element.find('[data-toggle]'); + this.$toggler = this.$element.find('[data-toggle]').filter(function() { + var target = $(this).data('toggle'); + return (target === targetID || target === ""); + }); this.options = $.extend({}, this.options, this.$targetMenu.data()); // If they were set, parse the animation classes diff --git a/test/visual/responsive-toggle/responsive-toggle.html b/test/visual/responsive-toggle/responsive-toggle.html new file mode 100644 index 000000000..1ec17a9cf --- /dev/null +++ b/test/visual/responsive-toggle/responsive-toggle.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + +
+ +
Menu
+ + + + +
+ +
+
+ +
+
+ +
+
+

Dropdown button should only show dropdown, menu buttons should only show menu

+ + + + +