Handle popstate on Chrome a bit better
This commit is contained in:
parent
805c40d3bf
commit
c2ac7e66b1
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user