Fix $.ready for Opera as it loads userscripts on window.onload and not document-start.

This commit is contained in:
Nicolas Stepien 2012-01-28 19:47:58 +01:00
parent 48afb6d880
commit 87c1fcc0fd
3 changed files with 5 additions and 2 deletions

View File

@ -312,7 +312,7 @@
$.extend($, { $.extend($, {
ready: function(fc) { ready: function(fc) {
var cb; var cb;
if (/interactive|complete/.test(d.readyState)) return fc(); if (/interactive|complete/.test(d.readyState)) return setTimeout(fc);
cb = function() { cb = function() {
$.off(d, 'DOMContentLoaded', cb); $.off(d, 'DOMContentLoaded', cb);
return fc(); return fc();

View File

@ -1,6 +1,7 @@
master master
- Mayhem - Mayhem
Index Navigation and the See next/previous thread keybinds will not cycle through board pages anymore. Index Navigation and the See next/previous thread keybinds will not cycle through board pages anymore.
Fix archive redirection in Opera.
2.24.4 2.24.4
- ahokadesuka - ahokadesuka

View File

@ -223,7 +223,9 @@ $.extend = (object, properties) ->
$.extend $, $.extend $,
ready: (fc) -> ready: (fc) ->
if /interactive|complete/.test d.readyState if /interactive|complete/.test d.readyState
return fc() # Execute the functions in parallel.
# If one fails, do not stop the others.
return setTimeout fc
cb = -> cb = ->
$.off d, 'DOMContentLoaded', cb $.off d, 'DOMContentLoaded', cb
fc() fc()