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