diff --git a/apps/common/main/lib/component/FocusManager.js b/apps/common/main/lib/component/FocusManager.js index b0f40b6cc..120f00d7e 100644 --- a/apps/common/main/lib/component/FocusManager.js +++ b/apps/common/main/lib/component/FocusManager.js @@ -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]) { diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 6c9ad704a..9ede2b633 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -984,6 +984,10 @@ define([ return []; }, + getDefaultFocusableComponent: function() { + return undefined; + }, + cancelButtonText: 'Cancel', okButtonText: 'OK', yesButtonText: 'Yes', diff --git a/apps/documenteditor/main/app/view/CustomColumnsDialog.js b/apps/documenteditor/main/app/view/CustomColumnsDialog.js index c2e6b69b5..cfb8b59c9 100644 --- a/apps/documenteditor/main/app/view/CustomColumnsDialog.js +++ b/apps/documenteditor/main/app/view/CustomColumnsDialog.js @@ -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; }, diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index 9047463ad..e4d455f53 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -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() {