##// 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 return arr;
143 return arr;
144 }
144 }
145
145
146 function processPostHiding(post) {
146 function processPostHiding(posts) {
147 var hiddenPosts = getHiddenPosts();
147 var hiddenPosts = getHiddenPosts();
148
149 $.each(posts, function(index) {
150 var post = $(this);
148 if (hiddenPosts.indexOf(post.attr("id")) > -1) {
151 if (hiddenPosts.indexOf(post.attr("id")) > -1) {
149 post.toggleClass("hidden_post");
152 post.toggleClass("hidden_post");
150 }
153 }
154 });
151 }
155 }
152
156
153 /**
157 /**
@@ -158,7 +162,7 b' function addScriptsToPost(post) {'
158 addRefLinkPreview(post[0]);
162 addRefLinkPreview(post[0]);
159 highlightCode(post);
163 highlightCode(post);
160 processVolumeUser(post.find("video,audio"));
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 compatibilityCrutches();
359 compatibilityCrutches();
356
360
357 $('.post').each(function(index) {
361 processPostHiding($('.post'));
358 processPostHiding($(this));
359 });
362 });
360 });
General Comments 0
You need to be logged in to leave comments. Login now