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