From: José Tomás Albornoz Date: Fri, 3 Oct 2014 18:17:23 +0000 (+0200) Subject: Closing only open dropdowns X-Git-Tag: v5.5.0~75^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5895%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Closing only open dropdowns Instead of iterating every dropdown, we're closing only the open ones. --- diff --git a/js/foundation/foundation.dropdown.js b/js/foundation/foundation.dropdown.js index a74c39dbc..d794b0d35 100644 --- a/js/foundation/foundation.dropdown.js +++ b/js/foundation/foundation.dropdown.js @@ -119,11 +119,12 @@ self.S(this).trigger('closed').trigger('closed.fndtn.dropdown', [dropdown]); } }); + dropdown.removeClass("f-open-" + this.attr_name(true)); }, closeall: function() { var self = this; - $.each(self.S('[' + this.attr_name() + '-content]'), function() { + $.each(self.S(".f-open-" + this.attr_name(true)), function() { self.close.call(self, self.S(this)); }); }, @@ -137,6 +138,7 @@ dropdown.attr('aria-hidden', 'false'); target.attr('aria-expanded', 'true'); dropdown.focus(); + dropdown.addClass("f-open-" + this.attr_name(true)); }, data_attr: function () {