Handle popstate on Chrome a bit better

This commit is contained in:
Zixaphir 2014-01-11 11:28:33 -07:00
parent 805c40d3bf
commit c2ac7e66b1
3 changed files with 24 additions and 20 deletions

View File

@ -11875,7 +11875,11 @@
if (g.VIEW === 'catalog' || g.BOARD.ID === 'f') {
return;
}
$.on(window, 'popstate', Navigate.popstate);
({
ready: function() {
return $.on(window, 'popstate', Navigate.popstate);
}
});
Thread.callbacks.push({
name: 'Navigate',
cb: this.thread

View File

@ -11864,7 +11864,11 @@
if (g.VIEW === 'catalog' || g.BOARD.ID === 'f') {
return;
}
$.on(window, 'popstate', Navigate.popstate);
({
ready: function() {
return $.on(window, 'popstate', Navigate.popstate);
}
});
Thread.callbacks.push({
name: 'Navigate',
cb: this.thread
@ -12194,15 +12198,12 @@
}
},
popstate: function() {
$.off(window, 'popstate', Navigate.popstate);
return $.on(window, 'popstate', Navigate.popstate = function() {
var a;
a = $.el('a', {
href: window.location,
id: 'popState'
});
return Navigate.navigate.call(a);
var a;
a = $.el('a', {
href: window.location,
id: 'popState'
});
return Navigate.navigate.call(a);
}
};

View File

@ -1,7 +1,10 @@
Navigate =
init: ->
return if g.VIEW is 'catalog' or g.BOARD.ID is 'f'
$.on window, 'popstate', Navigate.popstate
# blink/webkit throw a popstate on page load. Not what we want.
ready: ->
$.on window, 'popstate', Navigate.popstate
Thread.callbacks.push
name: 'Navigate'
@ -295,13 +298,9 @@ Navigate =
Unread.read()
Unread.update()
popstate: -> <% if (type === 'crx') { %>
$.off window, 'popstate', Navigate.popstate
$.on window, 'popstate', Navigate.popstate = ->
<% } %> # blink/webkit throw a popstate on page load. Not what we want.
popstate: ->
a = $.el 'a',
href: window.location
id: 'popState'
a = $.el 'a',
href: window.location
id: 'popState'
Navigate.navigate.call a
Navigate.navigate.call a