From 859fc90c9b873938f25d06f020c1c87abb097c08 Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 7 May 2011 22:00:42 -0700 Subject: [PATCH] fix --- 4chan_x.js | 16 ++++++++-------- script.coffee | 11 +++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index 9d9608505..afd03123f 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1698,16 +1698,16 @@ if (el = d.getElementById(id)) { qp.innerHTML = el.innerHTML; } else { + qp.innerHTML = "Loading " + id + "..."; threadID = this.pathname.split('/').pop(); - if ((req = g.requests[threadID]) && req.readyState === 4) { - quotePreview.parse(req, id, threadID); - } else { - qp.innerHTML = "Loading " + id + "..."; - if (!req) { - g.requests[threadID] = $.get(this.href, (function() { - return quotePreview.parse(this, id, threadID); - })); + if (req = g.requests[threadID]) { + if (req.readyState === 4) { + quotePreview.parse(req, id, threadID); } + } else { + g.requests[threadID] = $.get(this.href, (function() { + return quotePreview.parse(this, id, threadID); + })); } } $.show(qp); diff --git a/script.coffee b/script.coffee index b3efeeeab..e59ccdbc5 100644 --- a/script.coffee +++ b/script.coffee @@ -1354,14 +1354,13 @@ quotePreview = if el = d.getElementById id qp.innerHTML = el.innerHTML else + qp.innerHTML = "Loading #{id}..." threadID = @pathname.split('/').pop() - if (req = g.requests[threadID]) and req.readyState is 4 - quotePreview.parse req, id, threadID + if req = g.requests[threadID] + if req.readyState is 4 + quotePreview.parse req, id, threadID else - qp.innerHTML = "Loading #{id}..." - if not req - g.requests[threadID] = $.get @href, - (-> quotePreview.parse this, id, threadID) + g.requests[threadID] = $.get @href, (-> quotePreview.parse this, id, threadID) $.show qp ui.el = qp parse: (req, id, threadID) ->