Don't return watcher.watch() if there's no text.
This commit is contained in:
parent
e19cbc8fc5
commit
026903528a
@ -1875,18 +1875,19 @@
|
||||
return watcher.refresh();
|
||||
},
|
||||
watch: function(thread, id) {
|
||||
var el, props, watched, _name;
|
||||
var el, watched, _name;
|
||||
el = $('span.filetitle', thread);
|
||||
props.href = "/" + g.BOARD + "/res/" + id;
|
||||
if (!el.textContent) {
|
||||
el = $('blockquote', thread);
|
||||
if (!el.textContent) {
|
||||
return;
|
||||
if (el.textContent) {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
} else {
|
||||
props.textContent = d.title;
|
||||
}
|
||||
} else {
|
||||
props.textContent = "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25));
|
||||
}
|
||||
props = {
|
||||
textContent: "/" + g.BOARD + "/ - " + ($.innerText(el).slice(0, 25)),
|
||||
href: "/" + g.BOARD + "/res/" + id
|
||||
};
|
||||
watched = $.get('watched', {});
|
||||
watched[_name = g.BOARD] || (watched[_name] = {});
|
||||
watched[g.BOARD][id] = props;
|
||||
|
||||
@ -1539,13 +1539,15 @@ watcher =
|
||||
|
||||
watch: (thread, id) ->
|
||||
el = $ 'span.filetitle', thread
|
||||
props.href = "/#{g.BOARD}/res/#{id}"
|
||||
if not el.textContent
|
||||
el = $ 'blockquote', thread
|
||||
if not el.textContent
|
||||
return
|
||||
props =
|
||||
textContent: "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
href: "/#{g.BOARD}/res/#{id}"
|
||||
if el.textContent
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
else
|
||||
props.textContent = d.title
|
||||
else
|
||||
props.textContent = "/#{g.BOARD}/ - #{$.innerText(el)[...25]}"
|
||||
|
||||
watched = $.get 'watched', {}
|
||||
watched[g.BOARD] or= {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user