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

@ -287,7 +287,11 @@ marked.setOptions({
Topics.get_latest_undeleted_pid = function(tid, callback) {
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++) {
pidKeys.push('pid:' + pids[x] + ':deleted');
}

Loading…
Cancel
Save