Focus name when switching sidekicks

This commit is contained in:
Vincent Fiduccia 2015-10-30 14:57:38 -07:00
parent 62eaf29640
commit 4fa7ddfe34
2 changed files with 7 additions and 2 deletions

View File

@ -38,7 +38,12 @@ export default Ember.Component.extend(NewOrEdit, SelectTab, {
if ( this.$() )
{
this.$().children('[data-launchindex]').addClass('hide');
this.$().children('[data-launchindex="'+index+'"]').removeClass('hide');
var body = this.$().children('[data-launchindex="'+index+'"]')[0];
if ( body )
{
$(body).removeClass('hide');
$("INPUT[type='text']", body)[0].focus();
}
}
},

View File

@ -23,7 +23,7 @@ export function debouncedObserver(...args) {
return Ember.observer.apply(Ember, keys.concat(function() {
Ember.run.debounce(this, function() {
if ( this.state !== 'destroying' ) {
if ( this._state !== 'destroying' ) {
opt[0].apply(this);
}
}, opt[1] || 250, opt[2] || false);