From 27558ba6d6034b47b0832e2b77787d10cf0384c0 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 18 May 2014 20:43:44 -0700 Subject: [PATCH] use $.asap instead of specializing $.ready --- src/General/Main.coffee | 3 +-- src/General/lib/$.coffee | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index f789f447d..6e2f0717f 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -50,7 +50,7 @@ Main = Report.init() return when 'i.4cdn.org' - onReady = -> + $.asap (-> d.readyState isnt 'loading'), -> if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found'] Redirect.init() pathname = location.pathname.split '/' @@ -63,7 +63,6 @@ Main = $.on video, 'click', -> if !video.controls if video.paused then video.play() else video.pause() - $.ready onReady, true return # c.time 'All initializations' diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index 7fe77e407..d1da366d2 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -16,9 +16,9 @@ $.DAY = 24 * $.id = (id) -> d.getElementById id -$.ready = (fc, immediate) -> +$.ready = (fc) -> unless d.readyState is 'loading' - if immediate then fc() else $.queueTask fc + $.queueTask fc return cb = -> $.off d, 'DOMContentLoaded', cb