mirror of
https://github.com/flarum/core.git
synced 2025-08-05 07:57:46 +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:
@@ -10,21 +10,30 @@ export default Ember.Component.extend({
|
||||
active: Ember.computed.or('target.paneIsShowing', 'target.paneIsPinned'),
|
||||
|
||||
mouseEnter: function() {
|
||||
this.get('target').send('showPane');
|
||||
var target = this.get('target');
|
||||
if (target) {
|
||||
target.send('showPane');
|
||||
}
|
||||
},
|
||||
|
||||
mouseLeave: function() {
|
||||
this.get('target').send('hidePane');
|
||||
var target = this.get('target');
|
||||
if (target) {
|
||||
target.send('hidePane');
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
// WE HAVE TO GO BACK. WAAAAAALLLLLLTTTTT
|
||||
back: function() {
|
||||
this.get('target').send('transitionFromBackButton');
|
||||
this.set('target', null);
|
||||
this.sendAction('goBack');
|
||||
},
|
||||
|
||||
togglePinned: function() {
|
||||
this.get('target').send('togglePinned');
|
||||
var target = this.get('target');
|
||||
if (target) {
|
||||
target.send('togglePinned');
|
||||
}
|
||||
},
|
||||
|
||||
toggleDrawer: function() {
|
||||
|
Reference in New Issue
Block a user