mirror of
https://github.com/flarum/framework.git
synced 2025-01-10 13:03:43 +08:00
17 lines
421 B
JavaScript
17 lines
421 B
JavaScript
|
import Ember from 'ember';
|
||
|
|
||
|
export default Ember.Mixin.create({
|
||
|
focusEventOn: function() {
|
||
|
this.get('controller').on('focus', this, this.focus);
|
||
|
}.on('didInsertElement'),
|
||
|
|
||
|
focusEventOff: function() {
|
||
|
this.get('controller').off('focus', this, this.focus);
|
||
|
}.on('willDestroyElement'),
|
||
|
|
||
|
focus: function() {
|
||
|
this.$('input:first:visible:enabled').focus();
|
||
|
console.log('focus first')
|
||
|
}.on('didInsertElement')
|
||
|
});
|