[DE] added base class method

This commit is contained in:
Maxim Kadushkin 2020-10-21 11:10:11 +03:00
parent dd0359ce90
commit 1a6ef58774
4 changed files with 11 additions and 16 deletions

View file

@ -143,17 +143,17 @@ Common.UI.FocusManager = new(function() {
updateTabIndexes(true);
}
}
if ( e.getDefaultFocusedComponent )
setTimeout(function(){
e.getDefaultFocusedComponent().focus();
}, 100);
},
'window:show': function(e){
if (e && e.cid && _windows[e.cid] && !_windows[e.cid].fields) {
_windows[e.cid].fields = register(e.getFocusedComponents());
addTraps(_windows[e.cid]);
}
if (e && e.getDefaultFocusableComponent())
setTimeout(function(){
e.getDefaultFocusableComponent().focus();
}, 100);
},
'modal:close': function(e, last) {
if (e && e.cid && _windows[e.cid]) {

View file

@ -984,6 +984,10 @@ define([
return [];
},
getDefaultFocusableComponent: function() {
return undefined;
},
cancelButtonText: 'Cancel',
okButtonText: 'OK',
yesButtonText: 'Yes',

View file

@ -128,17 +128,13 @@ define([
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.updateMetricUnit();
// setTimeout(function(){
// me.spnColumns.focus();
// }, 100);
},
getFocusedComponents: function() {
return [this.spnColumns, this.spnSpacing];
},
getDefaultFocusedComponent: function () {
getDefaultFocusableComponent: function () {
return this.spnColumns;
},

View file

@ -341,7 +341,7 @@ define([
return [this.cmbFormat, this.cmbAlign, this.cmbSize, {cmp: this.levelsList, selector: '.listview'}];
},
getDefaultFocusedComponent: function () {
getDefaultFocusableComponent: function () {
return this.type > 0 ? this.cmbFormat : this.cmbAlign;
},
@ -360,11 +360,6 @@ define([
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
// var me = this;
// _.delay(function(){
// (me.type>0) ? me.cmbFormat.focus() : me.cmbAlign.focus();
// },100);
},
updateThemeColors: function() {