guard clause
This commit is contained in:
parent
6287bdc4dd
commit
6292a9dfea
10
4chan_x.js
10
4chan_x.js
@ -1702,7 +1702,7 @@
|
||||
if (html = g.cache[threadID]) {
|
||||
quotePreview.get(id, threadID, html);
|
||||
} else {
|
||||
qp.innerHTML = 'Loading...';
|
||||
qp.innerHTML = "Loading " + id + "...";
|
||||
$.get(this.href, (function() {
|
||||
html = this.responseText;
|
||||
g.cache[threadID] = html;
|
||||
@ -1714,7 +1714,11 @@
|
||||
return ui.el = qp;
|
||||
},
|
||||
get: function(id, threadID, innerHTML) {
|
||||
var body, html, reply, _i, _len, _ref;
|
||||
var body, html, qp, reply, _i, _len, _ref;
|
||||
qp = $('#qp');
|
||||
if (qp.innerHTML !== ("Loading " + id + "...")) {
|
||||
return;
|
||||
}
|
||||
body = $.el('body', {
|
||||
innerHTML: innerHTML
|
||||
});
|
||||
@ -1730,7 +1734,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
return ui.el.innerHTML = html;
|
||||
return qp.innerHTML = html;
|
||||
}
|
||||
};
|
||||
quickReport = {
|
||||
|
||||
@ -1358,7 +1358,7 @@ quotePreview =
|
||||
if html = g.cache[threadID]
|
||||
quotePreview.get id, threadID, html
|
||||
else
|
||||
qp.innerHTML = 'Loading...'
|
||||
qp.innerHTML = "Loading #{id}..."
|
||||
$.get @href, (->
|
||||
html = @responseText
|
||||
g.cache[threadID] = html
|
||||
@ -1367,8 +1367,9 @@ quotePreview =
|
||||
$.show qp
|
||||
ui.el = qp
|
||||
get: (id, threadID, innerHTML) ->
|
||||
qp = $ '#qp'
|
||||
return unless qp.innerHTML is "Loading #{id}..."
|
||||
body = $.el 'body', {innerHTML}
|
||||
|
||||
if id == threadID #OP
|
||||
html = $('blockquote', body).innerHTML
|
||||
else
|
||||
@ -1376,8 +1377,7 @@ quotePreview =
|
||||
if reply.id == id
|
||||
html = reply.innerHTML
|
||||
break
|
||||
|
||||
ui.el.innerHTML = html
|
||||
qp.innerHTML = html
|
||||
|
||||
quickReport =
|
||||
init: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user