Fix Navigate.popstate on Chrome

This commit is contained in:
Zixaphir 2014-01-10 23:14:02 -07:00
parent 865c5acfb6
commit 685f74de50
2 changed files with 12 additions and 7 deletions

View File

@ -12173,14 +12173,15 @@
} }
}, },
popstate: function() { popstate: function() {
return Navigate.popstate = function() { $.off(window, 'popstate', Navigate.popstate);
return $.on(window, 'popstate', Navigate.popstate = function() {
var a; var a;
a = $.el('a', { a = $.el('a', {
href: window.location, href: window.location,
id: 'popState' id: 'popState'
}); });
return Navigate.navigate.call(a); return Navigate.navigate.call(a);
}; });
}, },
refresh: function(context) { refresh: function(context) {
var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1; var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1;

View File

@ -290,12 +290,16 @@ Navigate =
Unread.read() Unread.read()
Unread.update() Unread.update()
popstate: -> <% if (type === 'crx') { %> Navigate.popstate = -> <% } %> # blink/webkit throw a popstate on page load. Not what we want. popstate: -> <% if (type === 'crx') { %>
a = $.el 'a', $.off window, 'popstate', Navigate.popstate
href: window.location $.on window, 'popstate', Navigate.popstate = ->
id: 'popState' <% } %> # blink/webkit throw a popstate on page load. Not what we want.
Navigate.navigate.call a a = $.el 'a',
href: window.location
id: 'popState'
Navigate.navigate.call a
refresh: (context) -> refresh: (context) ->
return return