Added tag list refreshing on tag edits

Result: suggestions etc. gets updated without the need to refresh the
page
This commit is contained in:
Marcin Kurczewski
2014-11-03 13:08:58 +01:00
parent 703cc4724a
commit 150d585860
4 changed files with 20 additions and 14 deletions

View File

@ -5,7 +5,8 @@ App.Presenters.PostEditPresenter = function(
util,
promise,
api,
auth) {
auth,
tagList) {
var $target;
var post;
@ -132,6 +133,7 @@ App.Presenters.PostEditPresenter = function(
promise.wait(api.put('/posts/' + post.id, formData))
.then(function(response) {
tagList.refreshTags();
if (typeof(updateCallback) !== 'undefined') {
updateCallback(post = response.json);
}
@ -153,4 +155,4 @@ App.Presenters.PostEditPresenter = function(
};
App.DI.register('postEditPresenter', ['util', 'promise', 'api', 'auth'], App.Presenters.PostEditPresenter);
App.DI.register('postEditPresenter', ['util', 'promise', 'api', 'auth', 'tagList'], App.Presenters.PostEditPresenter);