From a3aea27a13d16202b945257e728a3eaca29d20dc Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 30 Nov 2014 12:02:25 +0100 Subject: [PATCH] Fixed tag edits not triggering tag list updates --- public_html/js/Presenters/TagPresenter.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/public_html/js/Presenters/TagPresenter.js b/public_html/js/Presenters/TagPresenter.js index 6bc3e60f..1ea94ed0 100644 --- a/public_html/js/Presenters/TagPresenter.js +++ b/public_html/js/Presenters/TagPresenter.js @@ -128,6 +128,7 @@ App.Presenters.TagPresenter = function( promise.wait(api.put('/tags/' + tag.name, formData)) .then(function(response) { router.navigateInplace('#/tag/' + response.json.name); + tagList.refreshTags(); }).fail(function(response) { window.alert(response.json && response.json.error || 'An error occured.'); }); @@ -140,6 +141,7 @@ App.Presenters.TagPresenter = function( promise.wait(api.delete('/tags/' + tag.name)) .then(function(response) { router.navigate('#/tags'); + tagList.refreshTags(); }).fail(function(response) { window.alert(response.json && response.json.error || 'An error occured.'); }); @@ -151,6 +153,7 @@ App.Presenters.TagPresenter = function( promise.wait(api.put('/tags/' + tag.name + '/merge', {targetTag: targetTag})) .then(function(response) { router.navigate('#/tags'); + tagList.refreshTags(); }).fail(function(response) { window.alert(response.json && response.json.error || 'An error occured.'); }); @@ -183,4 +186,16 @@ App.Presenters.TagPresenter = function( }; -App.DI.register('tagPresenter', ['_', 'jQuery', 'util', 'promise', 'auth', 'api', 'tagList', 'router', 'keyboard', 'topNavigationPresenter', 'messagePresenter'], App.Presenters.TagPresenter); +App.DI.register('tagPresenter', [ + '_', + 'jQuery', + 'util', + 'promise', + 'auth', + 'api', + 'tagList', + 'router', + 'keyboard', + 'topNavigationPresenter', + 'messagePresenter'], +App.Presenters.TagPresenter);