Don't return watcher.watch() if there's no text.

This commit is contained in:
Nicolas Stepien 2011-08-23 05:16:08 +02:00
parent e19cbc8fc5
commit 026903528a
2 changed files with 15 additions and 12 deletions

View File

@ -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;

View File

@ -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= {}