Commits

edogawaconan committed 45ccec1

Fix overzealous preventDefault.

Comments (0)

Files changed (1)

app/assets/javascripts/zp.hash_magic.js

       }
     },
     set_hash: function(e) {
+      if (typeof e !== "undefined" &&
+          zp.formatter.links().filter(e.target).length === 0 &&
+          zp.viewer_width.links().filter(e.target).length === 0) { return }
       var
         format = zp.formatter.current(),
         width = zp.viewer_width.current,
       if (width !== "auto") { hash += "." + width }
       if (hash === "#!pl") { hash = " " }
       history.replaceState(null, "", hash)
-      if (e !== undefined) { e.preventDefault() }
+      if (typeof e !== "undefined") { e.preventDefault() }
     },
     init: function() {
       this.load_hash()