summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2016-08-28 23:55:45 +0200
committerrr- <rr-@sakuya.pl>2016-08-28 23:57:53 +0200
commitacd989cabbadf76e3ee33e901d99e07a37cd4a5e (patch)
treec543d117c45f30024968823761fd2a34816d9c5c /client
parent997eb3de63b9258dbd4d7030667b51c4b48f3808 (diff)
client/tags: fix URL redirections
User controller didn't need intervention but I refactored it to match tag controller anyway.
Diffstat (limited to 'client')
-rw-r--r--client/js/controllers/tag_controller.js9
-rw-r--r--client/js/controllers/user_controller.js6
2 files changed, 9 insertions, 6 deletions
diff --git a/client/js/controllers/tag_controller.js b/client/js/controllers/tag_controller.js
index 0951b16..74a6e4a 100644
--- a/client/js/controllers/tag_controller.js
+++ b/client/js/controllers/tag_controller.js
@@ -22,7 +22,7 @@ class TagController {
topNavigation.setTitle('Tag #' + tag.names[0]);
this._name = ctx.parameters.name;
- tag.addEventListener('change', e => this._evtSaved(e));
+ tag.addEventListener('change', e => this._evtSaved(e, section));
const categories = {};
for (let category of tags.getAllCategories()) {
@@ -57,10 +57,11 @@ class TagController {
misc.enableExitConfirmation();
}
- _evtSaved(e) {
+ _evtSaved(e, section) {
misc.disableExitConfirmation();
if (this._name !== e.detail.tag.names[0]) {
- router.replace('/tag/' + e.detail.tag.names[0], null, false);
+ router.replace(
+ '/tag/' + e.detail.tag.names[0] + '/' + section, null, false);
}
}
@@ -97,6 +98,8 @@ class TagController {
e.detail.tag.merge(e.detail.targetTagName).then(() => {
this._view.showSuccess('Tag merged.');
this._view.enableForm();
+ router.replace(
+ '/tag/' + e.detail.targetTagName + '/merge', null, false);
}, errorMessage => {
this._view.showError(errorMessage);
this._view.enableForm();
diff --git a/client/js/controllers/user_controller.js b/client/js/controllers/user_controller.js
index 0e2b961..e9aeb7d 100644
--- a/client/js/controllers/user_controller.js
+++ b/client/js/controllers/user_controller.js
@@ -26,7 +26,7 @@ class UserController {
const infix = isLoggedIn ? 'self' : 'any';
this._name = userName;
- user.addEventListener('change', e => this._evtSaved(e));
+ user.addEventListener('change', e => this._evtSaved(e, section));
const myRankIndex = api.user ?
api.allRanks.indexOf(api.user.rank) :
@@ -73,11 +73,11 @@ class UserController {
misc.enableExitConfirmation();
}
- _evtSaved(e) {
+ _evtSaved(e, section) {
misc.disableExitConfirmation();
if (this._name !== e.detail.user.name) {
router.replace(
- '/user/' + e.detail.user.name + '/edit', null, false);
+ '/user/' + e.detail.user.name + '/' + section, null, false);
}
}