From ee3b0c93c3fe20efe1e010121c066bc2d45df5c7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 17 Nov 2014 13:37:00 -0500 Subject: [PATCH] fix tag update was hanging on tag remove, and wasnt updating if tag count didnt change --- public/src/client/topic/events.js | 15 ++++++++++++++- src/topics/tags.js | 6 ++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/events.js b/public/src/client/topic/events.js index 055594bbf8..1318ae23df 100644 --- a/public/src/client/topic/events.js +++ b/public/src/client/topic/events.js @@ -107,7 +107,7 @@ define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', ' $(window).trigger('action:posts.edited'); }); - if (data.tags && data.tags.length !== $('.tags').first().children().length) { + if (data.tags && tagsUpdated(data.tags)) { templates.parse('partials/post_bar', 'tags', {tags: data.tags}, function(html) { var tags = $('.tags'); @@ -118,6 +118,19 @@ define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', ' } } + function tagsUpdated(tags) { + if (tags.length !== $('.tags').first().children().length) { + return true; + } + + for (var i=0; i