framework/ember/app/mixins/modal-view.js

16 lines
425 B
JavaScript
Raw Normal View History

2015-02-08 15:59:39 +10:30
import Ember from 'ember';
export default Ember.Mixin.create({
focusEventOn: Ember.on('didInsertElement', function() {
this.get('controller').on('focus', this, this.focus);
}),
2015-02-08 15:59:39 +10:30
focusEventOff: Ember.on('willDestroyElement', function() {
this.get('controller').off('focus', this, this.focus);
}),
2015-02-08 15:59:39 +10:30
focus: Ember.on('didInsertElement', function() {
this.$('input:first:visible:enabled').focus();
})
2015-02-08 15:59:39 +10:30
});