comparison app/assets/javascripts/zp.hash_magic.js @ 232:e3468efc9ec9

Do check if we're on the right place
author Edho Arief <edho@myconan.net>
date Sat, 25 May 2013 12:15:27 +0900
parents 6e9718a1ee11
children a9c45375a656
comparison
equal deleted inserted replaced
231:e021f4e76269 232:e3468efc9ec9
27 if (width !== "auto") { hash += "." + width } 27 if (width !== "auto") { hash += "." + width }
28 if (hash === "#!pl") { hash = " " } 28 if (hash === "#!pl") { hash = " " }
29 history.replaceState(null, "", hash) 29 history.replaceState(null, "", hash)
30 }, 30 },
31 init: function() { 31 init: function() {
32 if (!$("#paste").length) return
32 this.load_hash() 33 this.load_hash()
33 if (history.replaceState) { 34 if (history.replaceState) {
34 this.set_hash() 35 this.set_hash()
35 $(document).on('click', $.proxy(this.set_hash, this)) 36 $(document).on('click', $.proxy(this.set_hash, this))
36 } 37 }