File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -25,13 +25,15 @@ foreign import decodeURIComponent :: String -> String
2525foreign import hashChanged " " "
2626function hashChanged(handler) {
2727 return function() {
28- var getHash = function() {return document.location.href.split('#')[1] || '';};
29- window['__oldHash'] = " " ;
28+ var getHash = function() {
29+ return document.location.href.split('#').splice(1).join('#');
30+ };
31+ var oldHash = " " ;
3032 handler(" " )(getHash())();
3133 window.addEventListener(" hashchange " , function(ev) {
3234 var newHash = getHash();
33- handler(window['__oldHash'] )(newHash)();
34- window['__oldHash'] = newHash;
35+ handler(oldHash )(newHash)();
36+ oldHash = newHash;
3537 });
3638 };
3739}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function setHash(hash) {
1414
1515foreign import getHash " " "
1616function getHash() {
17- return document.location.href.split('#')[1] || " " ;
17+ return document.location.href.split('#').splice(1).join('#') ;
1818}
1919" " " :: forall e . Eff (dom :: DOM |e ) String
2020
You can’t perform that action at this time.
0 commit comments