Add focus for dialogs
This commit is contained in:
parent
5afd6e7609
commit
57aa29f3c8
|
@ -242,18 +242,31 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFocusedComponents: function() {
|
||||||
|
var arr = [];
|
||||||
|
this.inputPwd && arr.push(this.inputPwd);
|
||||||
|
this.cmbEncoding && arr.push(this.cmbEncoding);
|
||||||
|
this.cmbDelimiter && arr.push(this.cmbDelimiter);
|
||||||
|
this.inputDelimiter && arr.push(this.inputDelimiter);
|
||||||
|
this.btnAdvanced && arr.push(this.btnAdvanced);
|
||||||
|
this.txtDestRange && arr.push(this.txtDestRange);
|
||||||
|
|
||||||
|
return arr;
|
||||||
|
},
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
if (this.type == Common.Utils.importTextType.DRM) {
|
if (this.type == Common.Utils.importTextType.DRM) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
me.inputPwd.cmpEl.find('input').focus();
|
me.inputPwd.focus();
|
||||||
if (me.validatePwd)
|
if (me.validatePwd)
|
||||||
me.inputPwd.checkValidate();
|
me.inputPwd.checkValidate();
|
||||||
}, 500);
|
}, 500);
|
||||||
} else if (this.type == Common.Utils.importTextType.Data) {
|
} else {
|
||||||
setTimeout(function(){me.txtDestRange.focus();}, 500);
|
var cmp = me.txtDestRange ? me.txtDestRange : (me.cmbEncoding ? me.cmbEncoding : me.cmbDelimiter);
|
||||||
|
cmp && setTimeout(function(){cmp.focus();}, 500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -346,7 +359,8 @@ define([
|
||||||
editable: false,
|
editable: false,
|
||||||
disabled: true,
|
disabled: true,
|
||||||
search: true,
|
search: true,
|
||||||
itemsTemplate: itemsTemplate
|
itemsTemplate: itemsTemplate,
|
||||||
|
takeFocusOnClose: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cmbEncoding.setDisabled(false);
|
this.cmbEncoding.setDisabled(false);
|
||||||
|
@ -378,7 +392,8 @@ define([
|
||||||
{value: 1, displayValue: this.txtTab},
|
{value: 1, displayValue: this.txtTab},
|
||||||
{value: 5, displayValue: this.txtSpace},
|
{value: 5, displayValue: this.txtSpace},
|
||||||
{value: -1, displayValue: this.txtOther}],
|
{value: -1, displayValue: this.txtOther}],
|
||||||
editable: false
|
editable: false,
|
||||||
|
takeFocusOnClose: true
|
||||||
});
|
});
|
||||||
this.cmbDelimiter.setValue( (this.settings && this.settings.asc_getDelimiter()) ? this.settings.asc_getDelimiter() : 4);
|
this.cmbDelimiter.setValue( (this.settings && this.settings.asc_getDelimiter()) ? this.settings.asc_getDelimiter() : 4);
|
||||||
this.cmbDelimiter.on('selected', _.bind(this.onCmbDelimiterSelect, this));
|
this.cmbDelimiter.on('selected', _.bind(this.onCmbDelimiterSelect, this));
|
||||||
|
|
|
@ -114,13 +114,12 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
getFocusedComponents: function() {
|
||||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
return [this.inputPwd, this.repeatPwd];
|
||||||
|
},
|
||||||
|
|
||||||
var me = this;
|
getDefaultFocusableComponent: function () {
|
||||||
setTimeout(function(){
|
return this.inputPwd;
|
||||||
me.inputPwd.cmpEl.find('input').focus();
|
|
||||||
}, 500);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onPrimary: function(event) {
|
onPrimary: function(event) {
|
||||||
|
@ -136,12 +135,12 @@ define([
|
||||||
if (this.handler) {
|
if (this.handler) {
|
||||||
if (state == 'ok') {
|
if (state == 'ok') {
|
||||||
if (this.inputPwd.checkValidate() !== true) {
|
if (this.inputPwd.checkValidate() !== true) {
|
||||||
this.inputPwd.cmpEl.find('input').focus();
|
this.inputPwd.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.inputPwd.getValue() !== this.repeatPwd.getValue()) {
|
if (this.inputPwd.getValue() !== this.repeatPwd.getValue()) {
|
||||||
this.repeatPwd.checkValidate();
|
this.repeatPwd.checkValidate();
|
||||||
this.repeatPwd.cmpEl.find('input').focus();
|
this.repeatPwd.focus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,8 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
|
||||||
'<% } %>',
|
'<% } %>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join(''))
|
].join('')),
|
||||||
|
tabindex: 1
|
||||||
});
|
});
|
||||||
this.sortList.createNewItem = function(record) {
|
this.sortList.createNewItem = function(record) {
|
||||||
return new _CustomItem({
|
return new _CustomItem({
|
||||||
|
@ -201,6 +202,14 @@ define([ 'text!spreadsheeteditor/main/app/template/SortDialog.template',
|
||||||
this._setDefaults(this.props);
|
this._setDefaults(this.props);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getFocusedComponents: function() {
|
||||||
|
return [ this.btnAdd, this.btnDelete, this.btnCopy, this.btnOptions, this.btnUp, this.btnDown, this.sortList ];
|
||||||
|
},
|
||||||
|
|
||||||
|
getDefaultFocusableComponent: function () {
|
||||||
|
return this.sortList;
|
||||||
|
},
|
||||||
|
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
this.sortOptions = {
|
this.sortOptions = {
|
||||||
|
|
Loading…
Reference in a new issue