]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Closing only open dropdowns 5895/head
authorJosé Tomás Albornoz <jojo@eljojo.net>
Fri, 3 Oct 2014 18:17:23 +0000 (20:17 +0200)
committerJosé Tomás Albornoz <jojo@eljojo.net>
Fri, 3 Oct 2014 18:17:23 +0000 (20:17 +0200)
Instead of iterating every dropdown, we're closing only the open ones.

js/foundation/foundation.dropdown.js

index a74c39dbcc316560ef06f4abe5054e85b08f655c..d794b0d35b9c9a16f4ee8ef8f269969748f5f545 100644 (file)
           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));
       });
     },
         dropdown.attr('aria-hidden', 'false');
         target.attr('aria-expanded', 'true');
         dropdown.focus();
+        dropdown.addClass("f-open-" + this.attr_name(true));
     },
 
     data_attr: function () {