Focus in the first field for add registry and webhook page

This commit is contained in:
loganhz 2017-10-11 11:55:49 +08:00
parent fb6117b16e
commit a10dad2c4f
2 changed files with 7 additions and 0 deletions

View File

@ -58,6 +58,10 @@ export default Ember.Component.extend(NewOrEdit, {
if ( !this.get(`model.${driver}Config`) ) {
this.set(`model.${driver}Config`, def);
}
setTimeout(() => {
this.$('INPUT')[0].focus();
}, 500);
},
scaleHostActionChanged: function() {

View File

@ -10,6 +10,9 @@ export default Ember.Controller.extend(NewOrEdit, {
actions: {
selectDriver: function(name) {
setTimeout(() => {
$('main INPUT')[0].focus();
}, 500);
var driver = this.get('drivers').filterBy('name',name)[0];
this.set('activeDriver', driver.name);
this.set('model.registry.serverAddress', driver.value);