# HG changeset patch # User Edho Arief # Date 1368330493 -32400 # Node ID 45ccec189bd76218a5f2ee41f8328ac36b632544 # Parent 9bc35555d3e33e43e68b4442175289282e9597e3 Fix overzealous preventDefault. diff -r 9bc35555d3e3 -r 45ccec189bd7 app/assets/javascripts/zp.hash_magic.js --- a/app/assets/javascripts/zp.hash_magic.js Sun May 12 12:38:03 2013 +0900 +++ b/app/assets/javascripts/zp.hash_magic.js Sun May 12 12:48:13 2013 +0900 @@ -14,6 +14,9 @@ } }, 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, @@ -22,7 +25,7 @@ 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()