framework/ember/app/components/back-button.js
Toby Zerner 9ddc622929 Refactor index pane
So that it only loads when needed, and caches results so things are
nice and snappy
2015-02-06 10:32:45 +10:30

28 lines
616 B
JavaScript
Executable File

import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['back-button'],
classNameBindings: ['active'],
active: Ember.computed.or('target.paneIsShowing', 'target.paneIsPinned'),
mouseEnter: function() {
this.get('target').send('showPane');
},
mouseLeave: function() {
this.get('target').send('hidePane');
},
actions: {
back: function() {
this.get('target').send('transitionFromBackButton');
this.set('target', null);
},
togglePinned: function() {
this.get('target').send('togglePinned');
}
}
});