Merge pull request #15 from discourse/fix_back_button

FIX: Ensure that back button always redirects to the index page
This commit is contained in:
Arpit Jalan 2018-08-17 15:34:35 +05:30 committed by GitHub
commit 915657b8cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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() {

View File

@ -34,7 +34,7 @@
{{#if editing}}
<div class="name">
<div class="previous">
{{d-button action="goBack" icon="chevron-left" class="no-text btn-med"}}
{{d-button action="goHome" icon="chevron-left" class="no-text btn-med"}}
</div>
{{text-field value=selectedItem.name}}
</div>
@ -44,7 +44,7 @@
{{else}}
<div class="name">
<div class="previous">
{{d-button action="goBack" icon="chevron-left" class="no-text btn-med"}}
{{d-button action="goHome" icon="chevron-left" class="no-text btn-med"}}
</div>
<h2>{{selectedItem.name}}</h2>
{{d-button action="editName" icon="pencil" class="no-text btn-small"}}