Node.js based forum software built for the modern web
fixing issue with teasers showing deleted post info
Julian Lamfd38b60bd66f
diff --git a/public/src/app.js b/public/src/app.jsindex 6f77bb615a..6cc39b60b7 100644--- a/public/src/app.js+++ b/public/src/app.js@@ -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('');}diff --git a/src/topics.js b/src/topics.jsindex 75618dc453..fb167a21b0 100644--- a/src/topics.js+++ b/src/topics.js@@ -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');}