From 86a4957bd1ea3855af41a0ed0d401868cc91d77a Mon Sep 17 00:00:00 2001 From: Rishabh Nambiar <5862206+rishabhnambiar@users.noreply.github.com> Date: Fri, 17 Aug 2018 15:30:07 +0530 Subject: [PATCH] FIX: Ensure that back button always redirects to index page --- .../discourse/controllers/admin-plugins-explorer.js.es6 | 5 +++-- .../discourse/templates/admin/plugins-explorer.hbs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 index a5e00e3..66aad96 100644 --- a/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-plugins-explorer.js.es6 @@ -96,8 +96,9 @@ export default Ember.Controller.extend({ this.set('everEditing', false); }, - goBack() { - history.back(); + goHome() { + this.set('selectedQueryId', null); + this.transitionToRoute('adminPlugins.explorer'); }, resetParams() { diff --git a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs index 7148f09..4a5149a 100644 --- a/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs +++ b/assets/javascripts/discourse/templates/admin/plugins-explorer.hbs @@ -34,7 +34,7 @@ {{#if editing}}
{{text-field value=selectedItem.name}}
@@ -44,7 +44,7 @@ {{else}}

{{selectedItem.name}}

{{d-button action="editName" icon="pencil" class="no-text btn-small"}}