##// END OF EJS Templates
Update metadata panel only once when a multiple of posts in updated during...
neko259 -
r1073:5583a4cb default
parent child Browse files
Show More
@@ -104,6 +104,8 b' function getThreadDiff() {'
104 updatePost(post)
104 updatePost(post)
105 }
105 }
106
106
107 updateMetadataPanel();
108
107 // TODO Process removed posts if any
109 // TODO Process removed posts if any
108 $('.metapanel').attr('data-last-update', data.last_update);
110 $('.metapanel').attr('data-last-update', data.last_update);
109 })
111 })
@@ -121,8 +123,6 b' function updatePost(postHtml) {'
121
123
122 var threadBlock = $('div.thread');
124 var threadBlock = $('div.thread');
123
125
124 var lastUpdate = '';
125
126 var postId = post.attr('id');
126 var postId = post.attr('id');
127
127
128 // If the post already exists, replace it. Otherwise add as a new one.
128 // If the post already exists, replace it. Otherwise add as a new one.
@@ -139,16 +139,12 b' function updatePost(postHtml) {'
139 updateBumplimitProgress(1);
139 updateBumplimitProgress(1);
140 showNewPostsTitle(1);
140 showNewPostsTitle(1);
141
141
142 lastUpdate = post.children('.post-info').first()
143 .children('.pub_time').first().html();
144
145 if (bottom) {
142 if (bottom) {
146 scrollToBottom();
143 scrollToBottom();
147 }
144 }
148 }
145 }
149
146
150 processNewPost(post);
147 processNewPost(post);
151 updateMetadataPanel(lastUpdate)
152 }
148 }
153
149
154 /**
150 /**
@@ -186,13 +182,15 b' function getImageCount() {'
186 * Update post count, images count and last update time in the metadata
182 * Update post count, images count and last update time in the metadata
187 * panel.
183 * panel.
188 */
184 */
189 function updateMetadataPanel(lastUpdate) {
185 function updateMetadataPanel() {
190 var replyCountField = $('#reply-count');
186 var replyCountField = $('#reply-count');
191 var imageCountField = $('#image-count');
187 var imageCountField = $('#image-count');
192
188
193 replyCountField.text(getReplyCount());
189 replyCountField.text(getReplyCount());
194 imageCountField.text(getImageCount());
190 imageCountField.text(getImageCount());
195
191
192 var lastUpdate = $('.post:last').children('.post-info').first()
193 .children('.pub_time').first().html();
196 if (lastUpdate !== '') {
194 if (lastUpdate !== '') {
197 var lastUpdateField = $('#last-update');
195 var lastUpdateField = $('#last-update');
198 lastUpdateField.html(lastUpdate);
196 lastUpdateField.html(lastUpdate);
General Comments 0
You need to be logged in to leave comments. Login now