]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Conditionally preventDefault for dropdown buttons. Addresses #959 & looks similar... 1092/head
authorScott Jungling <sjungling@csuchico.edu>
Tue, 30 Oct 2012 19:02:54 +0000 (12:02 -0700)
committerScott Jungling <sjungling@csuchico.edu>
Tue, 30 Oct 2012 19:02:54 +0000 (12:02 -0700)
vendor/assets/javascripts/foundation/jquery.foundation.buttons.js

index 2b6b04bba1a7491b7f198a57a047ded7b78f97bb..01e267144687e165123388a10e514e8518f22946 100644 (file)
       var $el = $(this),
         button = $el.closest('.button.dropdown'),
         dropdown = $('> ul', button);
-      e.preventDefault();
+
+        // If the click is registered on an actual link then do not preventDefault which stops the browser from following the link
+        if (e.target.nodeName !== "A"){
+          e.preventDefault();
+        }
 
       // close other dropdowns
       closeDropdowns(config.dropdownAsToggle ? dropdown : '');