Fix Thread Stats slowdown; use querySelector once.
This commit is contained in:
parent
6e1de66b40
commit
faaf8a8c00
@ -2275,6 +2275,8 @@
|
||||
left: '0px'
|
||||
}, html);
|
||||
dialog.className = 'dialog';
|
||||
threadStats.postcountID = $('#postcount', dialog);
|
||||
threadStats.imagecountID = $('#imagecount', dialog);
|
||||
$.append(d.body, dialog);
|
||||
return g.callbacks.push(threadStats.node);
|
||||
},
|
||||
@ -2282,15 +2284,13 @@
|
||||
if (root.className) {
|
||||
return;
|
||||
}
|
||||
threadStats.posts++;
|
||||
threadStats.postcountID.textContent = ++threadStats.posts;
|
||||
if ($('img[md5]', root)) {
|
||||
threadStats.images++;
|
||||
threadStats.imagecountID.textContent = ++threadStats.images;
|
||||
if (threadStats.images > 150) {
|
||||
$('#imagecount').className = 'error';
|
||||
return threadStats.imagecountID.className = 'error';
|
||||
}
|
||||
}
|
||||
$('#postcount').textContent = threadStats.posts;
|
||||
return $('#imagecount').textContent = threadStats.images;
|
||||
}
|
||||
};
|
||||
unread = {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
- mayhem:
|
||||
- Fix Auto Watch Reply and prevent upload of too large files when auto posting
|
||||
- Thread Stats performance fix, especially on long threads
|
||||
|
||||
2.15.1
|
||||
- mayhem:
|
||||
|
||||
@ -1746,17 +1746,17 @@ threadStats =
|
||||
html = "<div class=move><span id=postcount>#{threadStats.posts}</span> / <span id=imagecount>#{threadStats.images}</span></div>"
|
||||
dialog = ui.dialog 'stats', bottom: '0px', left: '0px', html
|
||||
dialog.className = 'dialog'
|
||||
threadStats.postcountID = $ '#postcount', dialog
|
||||
threadStats.imagecountID = $ '#imagecount', dialog
|
||||
$.append d.body, dialog
|
||||
g.callbacks.push threadStats.node
|
||||
node: (root) ->
|
||||
return if root.className
|
||||
threadStats.posts++
|
||||
threadStats.postcountID.textContent = ++threadStats.posts
|
||||
if $ 'img[md5]', root
|
||||
threadStats.images++
|
||||
threadStats.imagecountID.textContent = ++threadStats.images
|
||||
if threadStats.images > 150
|
||||
$('#imagecount').className = 'error'
|
||||
$('#postcount').textContent = threadStats.posts
|
||||
$('#imagecount').textContent = threadStats.images
|
||||
threadStats.imagecountID.className = 'error'
|
||||
|
||||
unread =
|
||||
init: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user