diff app/assets/javascripts/zp.hash_magic.js @ 340:4b91c0c1938c

A more specific binding.
author edogawaconan <me@myconan.net>
date Wed, 28 May 2014 15:18:50 +0900
parents e855e58d137e
children
line wrap: on
line diff
--- a/app/assets/javascripts/zp.hash_magic.js	Sun May 11 16:53:45 2014 +0900
+++ b/app/assets/javascripts/zp.hash_magic.js	Wed May 28 15:18:50 2014 +0900
@@ -11,10 +11,6 @@
       tab_link(format).click()
     },
     set_hash: function(e) {
-      if (typeof e !== "undefined") {
-        if (zp.formatter.links().filter(e.target).length === 0) return
-        else e.preventDefault()
-      }
       var
         format = zp.formatter.current(),
         newpath = window.location.pathname
@@ -26,7 +22,7 @@
       this.load_hash()
       if (history.replaceState) {
         this.set_hash()
-        $(document).on('click', $.proxy(this.set_hash, this))
+        zp.formatter.links().on('shown.bs.tab', this.set_hash)
       }
     }
   }