From 3f2dfd9333cbb6c51fdd5aee5bc45fe1ca8ad3dc Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 18 Jul 2015 15:37:15 -0700 Subject: [PATCH] Index: Replace $.asap with $.onExists. --- src/General/Index.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 2dd42baa7..97d21500a 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -95,11 +95,10 @@ Index = @update() - $.asap (-> $('title + *', doc) or d.readyState isnt 'loading'), -> + $.onExists doc, 'title + *', true, -> d.title = d.title.replace /\ -\ Page\ \d+/, '' - $.asap (-> $('.board > .thread > .postContainer', doc) or d.readyState isnt 'loading'), -> - return unless Main.isThisPageLegit() + $.onExists doc, '.board > .thread > .postContainer, .board + *', true, -> Index.hat = $ '.board > .thread > img:first-child' if Index.hat and Index.nodes for threadRoot in Index.nodes @@ -123,8 +122,7 @@ Index = $.before topNavPos, $.el 'hr' $.before topNavPos, Index.navLinks - $.asap (-> $('.pagelist', doc) or d.readyState isnt 'loading'), -> - return unless Main.isThisPageLegit() + Main.ready -> if pagelist = $('.pagelist') $.replace pagelist, Index.pagelist else