mirror of
https://github.com/flarum/core.git
synced 2025-07-31 21:50:50 +02:00
Improve global back button. Goes back to previous interface.
It’s not quite like the browser’s back button because it doesn’t necessarily go back to the last URL; rather, it goes back to the last interface. So if you go into a discussion, then go to a different discussion via the side pane, the back button will still take you back to the index (not the previous discussion).
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
import AddCssClassToBody from 'flarum/mixins/add-css-class-to-body';
|
||||
import PushesHistory from 'flarum/mixins/pushes-history';
|
||||
|
||||
export default Ember.Route.extend(AddCssClassToBody, PushesHistory, {
|
||||
historyKey: 'index',
|
||||
|
||||
export default Ember.Route.extend(AddCssClassToBody, {
|
||||
cachedModel: null,
|
||||
|
||||
model: function() {
|
||||
@@ -13,7 +16,7 @@ export default Ember.Route.extend(AddCssClassToBody, {
|
||||
},
|
||||
|
||||
setupController: function(controller, model) {
|
||||
controller.set('model', model);
|
||||
this._super(controller, model);
|
||||
|
||||
if (!model.get('length')) {
|
||||
controller.send('loadResults');
|
||||
|
Reference in New Issue
Block a user