From 9a4e6aa01cdd3cce98a6e1542966d90b8f77fda4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 1 Jul 2014 14:49:45 -0400 Subject: [PATCH] closes #1774 --- public/src/forum/topic/events.js | 15 +++++++++++++-- src/postTools.js | 3 ++- src/socket.io/posts.js | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/public/src/forum/topic/events.js b/public/src/forum/topic/events.js index 133c7baeec..7241318380 100644 --- a/public/src/forum/topic/events.js +++ b/public/src/forum/topic/events.js @@ -91,8 +91,7 @@ define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', ' if (editedPostTitle.length) { editedPostTitle.fadeOut(250, function() { - editedPostTitle.html(data.title); - editedPostTitle.fadeIn(250); + editedPostTitle.html(data.title).fadeIn(250); }); } @@ -102,6 +101,18 @@ define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', ' app.replaceSelfLinks(editedPostEl.find('a')); editedPostEl.fadeIn(250); }); + + if (data.tags && data.tags.length !== $('.tags').first().children().length) { + ajaxify.loadTemplate('partials/post_bar', function(postBarTemplate) { + var html = templates.parse(templates.getBlock(postBarTemplate, 'tags'), { + tags: data.tags + }); + var tags = $('.tags'); + tags.fadeOut(250, function() { + tags.html(html).fadeIn(250); + }); + }); + } } function onPostPurged(pid) { diff --git a/src/postTools.js b/src/postTools.js index 4b129a7e23..b7361f14ee 100644 --- a/src/postTools.js +++ b/src/postTools.js @@ -76,7 +76,8 @@ var winston = require('winston'), next(null, { tid: tid, title: validator.escape(title), - isMainPost: isMainPost + isMainPost: isMainPost, + tags: options.tags.map(function(tag) { return {name:tag}; }) }); }); diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 6d425c7b8c..45ccdc2f75 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -174,6 +174,7 @@ SocketPosts.edit = function(socket, data, callback) { pid: data.pid, title: results.topic.title, isMainPost: results.topic.isMainPost, + tags: results.topic.tags, content: results.content });