##// END OF EJS Templates
Speed up post hiding, do not load the hidden posts list for each post being processed
neko259 -
r2082:47f758c2 default
parent child Browse files
Show More
@@ -143,11 +143,15 b' function getHiddenPosts() {'
143 143 return arr;
144 144 }
145 145
146 function processPostHiding(post) {
146 function processPostHiding(posts) {
147 147 var hiddenPosts = getHiddenPosts();
148 if (hiddenPosts.indexOf(post.attr("id")) > -1) {
149 post.toggleClass("hidden_post");
150 }
148
149 $.each(posts, function(index) {
150 var post = $(this);
151 if (hiddenPosts.indexOf(post.attr("id")) > -1) {
152 post.toggleClass("hidden_post");
153 }
154 });
151 155 }
152 156
153 157 /**
@@ -158,7 +162,7 b' function addScriptsToPost(post) {'
158 162 addRefLinkPreview(post[0]);
159 163 highlightCode(post);
160 164 processVolumeUser(post.find("video,audio"));
161 processPostHiding(post);
165 processPostHiding([post]);
162 166 }
163 167
164 168 /**
@@ -354,7 +358,5 b' function addContextMenu() {'
354 358
355 359 compatibilityCrutches();
356 360
357 $('.post').each(function(index) {
358 processPostHiding($(this));
359 });
361 processPostHiding($('.post'));
360 362 });
General Comments 0
You need to be logged in to leave comments. Login now