fixing issue with teasers showing deleted post info

v1.18.x
Julian Lam 12 years ago
parent 76aa644314
commit fd38b60bd6

@ -173,8 +173,7 @@ var socket,
if (localStorage && post_content.value.length > 0) { if (localStorage && post_content.value.length > 0) {
localStorage.setItem(post_mode + '_' + id + '_draft', post_content.value); localStorage.setItem(post_mode + '_' + id + '_draft', post_content.value);
jQuery(post_window).slideUp(250); app.close_post_window();
$(document.body).removeClass('composing');
post_title.value = ''; post_title.value = '';
reply_title.value = ''; reply_title.value = '';
post_content.value = ''; post_content.value = '';
@ -192,8 +191,11 @@ var socket,
} }
}; };
app.close_post_window = function() {
post_window = post_window || document.getElementById('post_window');
jQuery(post_window).slideUp(250);
$(document.body).removeClass('composing');
}
app.post_reply = function(topic_id) { app.post_reply = function(topic_id) {
var content = document.getElementById('post_content'); var content = document.getElementById('post_content');
@ -213,8 +215,7 @@ var socket,
'topic_id' : topic_id, 'topic_id' : topic_id,
'content' : content.value 'content' : content.value
}); });
jQuery(post_window).slideUp(250); app.close_post_window();
$(document.body).removeClass('composing');
content.value = ''; content.value = '';
}; };
app.post_topic = function(category_id) { app.post_topic = function(category_id) {
@ -238,8 +239,7 @@ var socket,
'category_id' : category_id 'category_id' : category_id
}); });
jQuery(post_window).slideUp(250); app.close_post_window();
$(document.body).removeClass('composing');
title.val(''); title.val('');
content.val(''); content.val('');
}; };
@ -260,8 +260,7 @@ var socket,
socket.emit('api:posts.edit', { pid: pid, content: content.val() }); socket.emit('api:posts.edit', { pid: pid, content: content.val() });
jQuery(post_window).slideUp(250); app.close_post_window();
$(document.body).removeClass('composing');
content.val(''); content.val('');
} }

@ -287,7 +287,11 @@ marked.setOptions({
Topics.get_latest_undeleted_pid = function(tid, callback) { Topics.get_latest_undeleted_pid = function(tid, callback) {
RDB.lrange('tid:' + tid + ':posts', 0, -1, function(err, pids) { RDB.lrange('tid:' + tid + ':posts', 0, -1, function(err, pids) {
var pidKeys = []; var pidKeys = [],
numPids = pids.length;
if (numPids === 0) return callback(null);
for(var x=0,numPids=pids.length;x<numPids;x++) { for(var x=0,numPids=pids.length;x<numPids;x++) {
pidKeys.push('pid:' + pids[x] + ':deleted'); pidKeys.push('pid:' + pids[x] + ':deleted');
} }

Loading…
Cancel
Save