]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Rebind event handler when call foundationTopBar repeatly 1024/head
authorayaya <ayaya@ayaya.tw>
Tue, 16 Oct 2012 12:02:50 +0000 (20:02 +0800)
committerayaya <ayaya@ayaya.tw>
Tue, 16 Oct 2012 12:02:50 +0000 (20:02 +0800)
vendor/assets/javascripts/foundation/jquery.foundation.topbar.js

index e84e805cd96eb3d3e7f78c300d605cc4fec481ea..8c7beb705ebd3279bc30bb1c5cbdefca7409b88a 100644 (file)
@@ -35,7 +35,7 @@
             methods.largestUL();
           }
 
-          $('.top-bar .toggle-topbar').live('click.fndtn', function (e) {
+          $('.top-bar .toggle-topbar').die('click.fndtn').live('click.fndtn', function (e) {
             e.preventDefault();
 
             if (methods.breakpoint()) {
@@ -46,7 +46,7 @@
           });
 
           // Show the Dropdown Levels on Click
-          $('.top-bar .has-dropdown>a').live('click.fndtn', function (e) {
+          $('.top-bar .has-dropdown>a').die('click.fndtn').live('click.fndtn', function (e) {
             if (Modernizr.touch || methods.breakpoint())
               e.preventDefault();
 
@@ -69,7 +69,7 @@
           });
 
           // Go up a level on Click
-          $('.top-bar .has-dropdown .back').live('click.fndtn', function (e) {
+          $('.top-bar .has-dropdown .back').die('click.fndtn').live('click.fndtn', function (e) {
             e.preventDefault();
 
             var $this = $(this),