diff --git a/apps/common/main/lib/view/ExtendedColorDialog.js b/apps/common/main/lib/view/ExtendedColorDialog.js index 112a3bf9f..5ad485937 100644 --- a/apps/common/main/lib/view/ExtendedColorDialog.js +++ b/apps/common/main/lib/view/ExtendedColorDialog.js @@ -58,8 +58,7 @@ define([ }), header: false, width: 340, - height: 272, - focusManager: true + height: 272 }); this.hexRe = /\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/; @@ -144,11 +143,13 @@ define([ if (this.color!==undefined) this.setColor(this.color); - this.focusManager.add([this.spinR, this.spinG, this.spinB], '.form-control'); - this.focusManager.add(this.textColor, 'input'); return this; }, + getFocusedComponents: function() { + return [this.spinR, this.spinG, this.spinB, {cmp: this.textColor, selector: 'input'}]; + }, + onChangeColor: function(o, color) { this.colorNew.css({'background-color' : color}); diff --git a/apps/common/main/lib/view/ListSettingsDialog.js b/apps/common/main/lib/view/ListSettingsDialog.js index 5099ec485..7ba0754a4 100644 --- a/apps/common/main/lib/view/ListSettingsDialog.js +++ b/apps/common/main/lib/view/ListSettingsDialog.js @@ -58,8 +58,7 @@ define([ style: 'min-width: 240px;', cls: 'modal-dlg', split: false, - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -319,8 +318,10 @@ define([ el.width(Math.max($window.find('.numbering .text').width(), el.width())); this.afterRender(); + }, - this.focusManager.add([this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart], '.form-control'); + getFocusedComponents: function() { + return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart]; }, afterRender: function() { diff --git a/apps/documenteditor/main/app/view/CaptionDialog.js b/apps/documenteditor/main/app/view/CaptionDialog.js index f50371a53..b7141a365 100644 --- a/apps/documenteditor/main/app/view/CaptionDialog.js +++ b/apps/documenteditor/main/app/view/CaptionDialog.js @@ -49,8 +49,7 @@ define([ DE.Views.CaptionDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 351, - height: 350, - focusManager: true + height: 350 }, initialize : function(options) { @@ -344,11 +343,13 @@ define([ this.lblExample = this.$window.find('#caption-label-example'); - this.focusManager.add([this.txtCaption, this.cmbPosition, this.cmbLabel, this.cmbNumbering, this.cmbChapter, this.cmbSeparator], '.form-control'); - this.afterRender(); }, + getFocusedComponents: function() { + return [this.txtCaption, this.cmbPosition, this.cmbLabel, this.cmbNumbering, this.cmbChapter, this.cmbSeparator]; + }, + afterRender: function() { this._setDefaults(this.props); diff --git a/apps/documenteditor/main/app/view/CellsAddDialog.js b/apps/documenteditor/main/app/view/CellsAddDialog.js index 7d303f674..7eb5004a6 100644 --- a/apps/documenteditor/main/app/view/CellsAddDialog.js +++ b/apps/documenteditor/main/app/view/CellsAddDialog.js @@ -52,8 +52,7 @@ define([ header: true, style: 'min-width: 214px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -129,13 +128,16 @@ define([ var $window = this.getChild(); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - this.focusManager.add([this.cmbRowCol, this.spnCount], '.form-control'); var me = this; setTimeout(function(){ me.spnCount.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.cmbRowCol, this.spnCount]; + }, + _handleInput: function(state) { if (this.options.handler) { this.options.handler.call(this, state, this.getSettings()); diff --git a/apps/documenteditor/main/app/view/CustomColumnsDialog.js b/apps/documenteditor/main/app/view/CustomColumnsDialog.js index 7fea303a6..bc0d05d4d 100644 --- a/apps/documenteditor/main/app/view/CustomColumnsDialog.js +++ b/apps/documenteditor/main/app/view/CustomColumnsDialog.js @@ -50,8 +50,7 @@ define([ header: true, style: 'min-width: 216px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -130,12 +129,15 @@ define([ this.updateMetricUnit(); - this.focusManager.add([this.spnColumns, this.spnSpacing], '.form-control'); setTimeout(function(){ me.spnColumns.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.spnColumns, this.spnSpacing]; + }, + _handleInput: function(state) { if (this.options.handler) { this.options.handler.call(this, this, state); diff --git a/apps/documenteditor/main/app/view/DateTimeDialog.js b/apps/documenteditor/main/app/view/DateTimeDialog.js index 733d18e2e..4d57c2dc6 100644 --- a/apps/documenteditor/main/app/view/DateTimeDialog.js +++ b/apps/documenteditor/main/app/view/DateTimeDialog.js @@ -50,8 +50,7 @@ define([ width: 350, style: 'min-width: 230px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function (options) { @@ -175,13 +174,15 @@ define([ this._setDefaults(); - this.focusManager.add([this.cmbLang], '.form-control'); - this.focusManager.add([this.listFormats], '.listview'); setTimeout(function(){ me.cmbLang.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.cmbLang, {cmp: this.listFormats, selector: '.listview'}]; + }, + _setDefaults: function () { this.props = new Asc.CAscDateTime(); if (this.lang) { diff --git a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js index d5313e202..7f1827bc1 100644 --- a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js @@ -58,8 +58,7 @@ define([ width: 350, style: 'min-width: 230px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -183,10 +182,10 @@ define([ me.internalList.on('entervalue', _.bind(me.onPrimary, me)); me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); + }, - this.focusManager.add(this.inputUrl, '.form-control'); - this.focusManager.add(this.internalList, '.treeview'); - this.focusManager.add([this.inputDisplay, this.inputTip], '.form-control'); + getFocusedComponents: function() { + return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputDisplay, this.inputTip]; }, ShowHideElem: function(value) { diff --git a/apps/documenteditor/main/app/view/NoteSettingsDialog.js b/apps/documenteditor/main/app/view/NoteSettingsDialog.js index 7b4f48182..d34caf72b 100644 --- a/apps/documenteditor/main/app/view/NoteSettingsDialog.js +++ b/apps/documenteditor/main/app/view/NoteSettingsDialog.js @@ -50,8 +50,7 @@ define([ options: { contentWidth: 300, height: 380, - buttons: null, - focusManager: true + buttons: null }, initialize : function(options) { @@ -283,10 +282,13 @@ define([ this.afterRender(); }, + getFocusedComponents: function() { + return [this.cmbFootnote, this.cmbEndnote, this.cmbFormat, this.spnStart, this.cmbNumbering, this.txtCustom, this.cmbApply]; + }, + afterRender: function() { this._setDefaults(this.props); - this.focusManager.add([this.cmbFootnote, this.cmbEndnote, this.cmbFormat, this.spnStart, this.cmbNumbering, this.txtCustom, this.cmbApply], '.form-control'); var me = this; setTimeout(function(){ me.cmbFormat.focus(); diff --git a/apps/documenteditor/main/app/view/PageMarginsDialog.js b/apps/documenteditor/main/app/view/PageMarginsDialog.js index 5a07f94e0..cf8f8641b 100644 --- a/apps/documenteditor/main/app/view/PageMarginsDialog.js +++ b/apps/documenteditor/main/app/view/PageMarginsDialog.js @@ -50,8 +50,7 @@ define([ style: 'min-width: 404px;', cls: 'modal-dlg', id: 'window-page-margins', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -308,13 +307,16 @@ define([ this.updateMetricUnit(); - this.focusManager.add([this.spnTop, this.spnBottom, this.spnLeft, this.spnRight, this.spnGutter, this.cmbGutterPosition, this.cmbOrientation, this.cmbMultiplePages], '.form-control'); var me = this; setTimeout(function(){ me.spnTop.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.spnTop, this.spnBottom, this.spnLeft, this.spnRight, this.spnGutter, this.cmbGutterPosition, this.cmbOrientation, this.cmbMultiplePages]; + }, + _handleInput: function(state) { if (this.options.handler) { if (state == 'ok') { diff --git a/apps/documenteditor/main/app/view/PageSizeDialog.js b/apps/documenteditor/main/app/view/PageSizeDialog.js index f1dd0f770..9f233f36b 100644 --- a/apps/documenteditor/main/app/view/PageSizeDialog.js +++ b/apps/documenteditor/main/app/view/PageSizeDialog.js @@ -50,8 +50,7 @@ define([ style: 'min-width: 216px;', cls: 'modal-dlg', id: 'window-page-size', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -169,13 +168,16 @@ define([ this.updateMetricUnit(); - this.focusManager.add([this.cmbPreset, this.spnWidth, this.spnHeight], '.form-control'); var me = this; setTimeout(function(){ me.cmbPreset.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.cmbPreset, this.spnWidth, this.spnHeight]; + }, + _handleInput: function(state) { if (this.options.handler) { this.options.handler.call(this, this, state); diff --git a/apps/documenteditor/main/app/view/StyleTitleDialog.js b/apps/documenteditor/main/app/view/StyleTitleDialog.js index 9e9016256..f014bd61b 100644 --- a/apps/documenteditor/main/app/view/StyleTitleDialog.js +++ b/apps/documenteditor/main/app/view/StyleTitleDialog.js @@ -48,8 +48,7 @@ define([ height: 196, style: 'min-width: 230px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -110,8 +109,10 @@ define([ disabled : (this.options.formats.length==0) }); this.cmbNextStyle.setValue(-1); + }, - this.focusManager.add([this.inputTitle, this.cmbNextStyle], '.form-control'); + getFocusedComponents: function() { + return [this.inputTitle, this.cmbNextStyle]; }, show: function() { diff --git a/apps/documenteditor/main/app/view/TableFormulaDialog.js b/apps/documenteditor/main/app/view/TableFormulaDialog.js index 51500d6a2..ab6418ca7 100644 --- a/apps/documenteditor/main/app/view/TableFormulaDialog.js +++ b/apps/documenteditor/main/app/view/TableFormulaDialog.js @@ -48,8 +48,7 @@ define([ width: 300, style: 'min-width: 230px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -164,8 +163,10 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.afterRender(); + }, - this.focusManager.add([this.inputFormula, this.cmbFormat, this.cmbFunction, this.cmbBookmark], '.form-control'); + getFocusedComponents: function() { + return [this.inputFormula, this.cmbFormat, this.cmbFunction, this.cmbBookmark]; }, onSelectItem: function(picker, item, record, e){ diff --git a/apps/presentationeditor/main/app/view/DateTimeDialog.js b/apps/presentationeditor/main/app/view/DateTimeDialog.js index 3ca907fbc..a632bc0f0 100644 --- a/apps/presentationeditor/main/app/view/DateTimeDialog.js +++ b/apps/presentationeditor/main/app/view/DateTimeDialog.js @@ -50,8 +50,7 @@ define([ width: 350, style: 'min-width: 230px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function (options) { @@ -175,12 +174,15 @@ define([ this._setDefaults(); - this.focusManager.add([this.cmbLang, this.listFormats], '.form-control'); setTimeout(function(){ me.cmbLang.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.cmbLang, {cmp: this.listFormats, selector: '.listview'}]; + }, + _setDefaults: function () { this.props = new AscCommonSlide.CAscDateTime(); if (this.lang) { diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index 9a315da06..cdae51864 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -60,8 +60,7 @@ define([ style: 'min-width: 230px;', cls: 'modal-dlg', id: 'window-hyperlink-settings', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -186,10 +185,10 @@ define([ me.internalList.on('entervalue', _.bind(me.onPrimary, me)); me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); + }, - this.focusManager.add(this.inputUrl, '.form-control'); - this.focusManager.add(this.internalList, '.treeview'); - this.focusManager.add([this.inputDisplay, this.inputTip], '.form-control'); + getFocusedComponents: function() { + return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputDisplay, this.inputTip]; }, setSettings: function (props) { diff --git a/apps/presentationeditor/main/app/view/SlideSizeSettings.js b/apps/presentationeditor/main/app/view/SlideSizeSettings.js index a9f27dbc3..d2a7483b1 100644 --- a/apps/presentationeditor/main/app/view/SlideSizeSettings.js +++ b/apps/presentationeditor/main/app/view/SlideSizeSettings.js @@ -50,8 +50,7 @@ define([ style: 'min-width: 250px;', cls: 'modal-dlg', id: 'window-slide-size-settings', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -204,13 +203,16 @@ define([ this.updateMetricUnit(); - this.focusManager.add([this.cmbSlideSize, this.spnWidth, this.spnHeight, this.cmbSlideOrientation], '.form-control'); var me = this; setTimeout(function(){ me.cmbSlideSize.focus(); }, 100); }, + getFocusedComponents: function() { + return [this.cmbSlideSize, this.spnWidth, this.spnHeight, this.cmbSlideOrientation]; + }, + _handleInput: function(state) { if (this.options.handler) { this.options.handler.call(this, this, state); diff --git a/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js b/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js index 76e75ba10..8cd508504 100644 --- a/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AdvancedSeparatorDialog.js @@ -47,8 +47,7 @@ define([ options: { width: 330, cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -96,11 +95,13 @@ define([ var $window = this.getChild(); $window.find('.btn').on('click', _.bind(this.onBtnClick, this)); - this.focusManager.add([this.inputDecimalSeparator, this.inputThousandsSeparator], '.form-control'); - this.afterRender(); }, + getFocusedComponents: function() { + return [this.inputDecimalSeparator, this.inputThousandsSeparator]; + }, + afterRender: function() { this._setDefaults(this.props); }, diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index cd19edffe..faffb3603 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -61,8 +61,7 @@ define([ cls : 'filter-dlg', contentTemplate : '', title : t.txtTitle, - items : [], - focusManager: true + items : [] }, options); this.template = options.template || [ @@ -188,9 +187,12 @@ define([ this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.loadDefaults(); - - this.focusManager.add([this.cmbCondition1, this.cmbValue1, this.cmbCondition2, this.cmbValue2], '.form-control'); }, + + getFocusedComponents: function() { + return [this.cmbCondition1, this.cmbValue1, this.cmbCondition2, this.cmbValue2]; + }, + show: function () { Common.UI.Window.prototype.show.call(this); @@ -321,8 +323,7 @@ define([ contentTemplate : '', title : t.txtTitle, items : [], - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, options); this.template = options.template || [ @@ -411,8 +412,12 @@ define([ this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.loadDefaults(); - this.focusManager.add([this.cmbType, this.spnCount, this.cmbItem, this.cmbFields], '.form-control'); }, + + getFocusedComponents: function() { + return [this.cmbType, this.spnCount, this.cmbItem, this.cmbFields]; + }, + show: function () { Common.UI.Window.prototype.show.call(this); @@ -530,8 +535,7 @@ define([ cls : 'filter-dlg', contentTemplate : '', title : (options.type=='label') ? t.txtTitleLabel : t.txtTitleValue, - items : [], - focusManager: true + items : [] }, options); this.api = options.api; @@ -651,8 +655,12 @@ define([ this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.loadDefaults(); - this.focusManager.add([this.cmbFields, this.cmbCondition1, this.inputValue, this.inputValue2], '.form-control'); }, + + getFocusedComponents: function() { + return [this.cmbFields, this.cmbCondition1, this.inputValue, this.inputValue2]; + }, + show: function () { Common.UI.Window.prototype.show.call(this); diff --git a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js index c4a65ef18..d5dd63265 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js @@ -52,8 +52,7 @@ define([ type: 0, // 0 - category, 1 - series width : 350, cls : 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -172,12 +171,15 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); - this.focusManager.add([me.inputRange1, me.inputRange2, me.inputRange3], '.form-control'); setTimeout(function(){ me.inputRange1.cmpEl.find('input').focus(); }, 10); }, + getFocusedComponents: function() { + return [this.inputRange1, this.inputRange2, this.inputRange3]; + }, + onPrimary: function() { this._handleInput('ok'); return false; diff --git a/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js b/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js index 94d7bd99c..0f8e1f062 100644 --- a/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js +++ b/apps/spreadsheeteditor/main/app/view/CreatePivotDialog.js @@ -48,8 +48,7 @@ define([ SSE.Views.CreatePivotDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 310, - height: 250, - focusManager: true + height: 250 }, initialize : function(options) { @@ -162,11 +161,13 @@ define([ me.txtDestRange.cmpEl.find('input').focus(); }); - this.focusManager.add([this.txtSourceRange, this.txtDestRange], '.form-control'); - this.afterRender(); }, + getFocusedComponents: function() { + return [this.txtSourceRange, this.txtDestRange]; + }, + afterRender: function() { this._setDefaults(this.props); diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index c1e6e125c..f46d9b3f6 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -49,8 +49,7 @@ define([ SSE.Views.FormatSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 284, - height: 340, - focusManager: true + height: 340 }, initialize : function(options) { @@ -249,11 +248,13 @@ define([ this.lblExample = this.$window.find('#format-settings-label-example'); - this.focusManager.add([this.cmbFormat, this.spnDecimal, this.cmbSymbols, this.cmbNegative, this.cmbType, this.cmbCode], '.form-control'); - this.afterRender(); }, + getFocusedComponents: function() { + return [this.cmbFormat, this.spnDecimal, this.cmbSymbols, this.cmbNegative, this.cmbType, this.cmbCode]; + }, + afterRender: function() { this._setDefaults(this.props); var cmp = this.cmbFormat; diff --git a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js index dd7c2d540..05504aa4b 100644 --- a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js @@ -63,8 +63,7 @@ define([ contentTemplate : '', title : t.txtTitle, items : [], - buttons: null, - focusManager: true + buttons: null }, options); this.template = options.template || [ @@ -115,7 +114,6 @@ define([ } me.filterFormulas(); }); - this.focusManager.add(this.inputSearch._input); this.btnOk = new Common.UI.Button({ el: $('#formula-dlg-btn-ok') @@ -125,6 +123,11 @@ define([ this.descLabel = $('#formula-dlg-desc'); this.fillFormulasGroups(); }, + + getFocusedComponents: function() { + return [this.inputSearch, this.cmbFuncGroup, {cmp: this.cmbListFunctions, selector: '.listview'}]; + }, + show: function (group) { if (this.$window) { var main_width, main_height, top, left, win_height = this.initConfig.height; @@ -249,7 +252,6 @@ define([ takeFocusOnClose: true }); this.cmbFuncGroup.on('selected', _.bind(this.onSelectGroup, this)); - this.focusManager.add(this.cmbFuncGroup, '.form-control'); } else { this.cmbFuncGroup.setData(groupsListItems); } @@ -280,8 +282,6 @@ define([ this.cmbListFunctions.onKeyDown = _.bind(this.onKeyDown, this.cmbListFunctions); this.cmbListFunctions.scrollToRecord = _.bind(this.onScrollToRecordCustom, this.cmbListFunctions); this.onUpdateFocus(); - - this.focusManager.add(this.cmbListFunctions, '.listview'); } if (this.functions) { diff --git a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js index f0fbaea74..6ff845a12 100644 --- a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js @@ -55,8 +55,7 @@ define([ width : 350, style : 'min-width: 230px;', cls : 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -250,10 +249,10 @@ define([ me.externalPanel = $window.find('#id-external-link'); me.internalPanel = $window.find('#id-internal-link'); + }, - this.focusManager.add(this.inputUrl, '.form-control'); - this.focusManager.add(this.internalList, '.treeview'); - this.focusManager.add([this.inputRange, this.inputDisplay, this.inputTip], '.form-control'); + getFocusedComponents: function() { + return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputRange, this.inputDisplay, this.inputTip]; }, show: function() { diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js index a8e4cef06..52f753885 100644 --- a/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/NamedRangeEditDlg.js @@ -52,8 +52,7 @@ define([ options: { alias: 'NamedRangeEditDlg', contentWidth: 380, - height: 250, - focusManager: true + height: 250 }, initialize: function (options) { @@ -173,11 +172,13 @@ define([ }); this.txtDataRange.on('button:click', _.bind(this.onSelectData, this)); - this.focusManager.add([this.inputName, this.cmbScope, this.txtDataRange], '.form-control'); - this.afterRender(); }, + getFocusedComponents: function() { + return [this.inputName, this.cmbScope, this.txtDataRange]; + }, + afterRender: function() { this._setDefaults(this.props); this.setTitle((this.isEdit) ? this.txtTitleEdit : this.txtTitleNew); diff --git a/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js b/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js index 226c55e42..de23fe256 100644 --- a/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/PageMarginsDialog.js @@ -50,8 +50,7 @@ define([ style: 'min-width: 216px;', cls: 'modal-dlg', id: 'window-page-margins', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -147,7 +146,6 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $window.find('input').on('keypress', _.bind(this.onKeyPress, this)); - this.focusManager.add(this.spinners, '.form-control'); var cmp = this.spnTop; setTimeout(function(){ (cmp.$el || $(cmp.el)).find('.form-control').focus(); @@ -156,6 +154,10 @@ define([ this.updateMetricUnit(); }, + getFocusedComponents: function() { + return this.spinners; + }, + _handleInput: function(state) { if (this.options.handler) this.options.handler.call(this, this, state); diff --git a/apps/spreadsheeteditor/main/app/view/PrintSettings.js b/apps/spreadsheeteditor/main/app/view/PrintSettings.js index 630e3dc7a..a19d93f25 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PrintSettings.js @@ -52,8 +52,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', alias: 'PrintSettings', contentWidth: 280, height: 575, - buttons: null, - focusManager: true + buttons: null }, initialize : function(options) { @@ -278,14 +277,17 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template', this.extended = (value!==null && parseInt(value)==0); this.handlerShowDetails(this.btnHide); - this.focusManager.add([this.cmbRange, this.cmbSheet, this.cmbPaperSize, this.cmbPaperOrientation, this.cmbLayout, this.txtRangeTop, this.txtRangeLeft, - this.spnMarginTop, this.spnMarginBottom, this.spnMarginLeft, this.spnMarginRight], '.form-control'); var me = this; setTimeout(function(){ me.cmbRange.focus(); },100); }, + getFocusedComponents: function() { + return [this.cmbRange, this.cmbSheet, this.cmbPaperSize, this.cmbPaperOrientation, this.cmbLayout, this.txtRangeTop, this.txtRangeLeft, + this.spnMarginTop, this.spnMarginBottom, this.spnMarginLeft, this.spnMarginRight]; + }, + addCustomScale: function (add) { if (add) { this.cmbLayout.setData([ diff --git a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js index a303c4b38..58c7834af 100644 --- a/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/PrintTitlesDialog.js @@ -50,8 +50,7 @@ define([ style: 'min-width: 216px;', cls: 'modal-dlg', id: 'window-page-margins', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -186,12 +185,15 @@ define([ this.setSettings(); - this.focusManager.add([this.txtRangeTop, this.txtRangeLeft], '.form-control'); setTimeout(function(){ me.txtRangeTop.focus(); },100); }, + getFocusedComponents: function() { + return [this.txtRangeTop, this.txtRangeLeft]; + }, + isRangeValid: function() { if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeTop.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) { this.txtRangeTop.focus(); diff --git a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js index e8e633df5..9189c170d 100644 --- a/apps/spreadsheeteditor/main/app/view/ScaleDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ScaleDialog.js @@ -50,8 +50,7 @@ define([ header: true, style: 'min-width: 215px;', cls: 'modal-dlg', - buttons: ['ok', 'cancel'], - focusManager: true + buttons: ['ok', 'cancel'] }, initialize : function(options) { @@ -166,8 +165,10 @@ define([ $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.afterRender(); + }, - this.focusManager.add([this.cmbScaleWidth, this.cmbScaleHeight, this.spnScale], '.form-control'); + getFocusedComponents: function() { + return [this.cmbScaleWidth, this.cmbScaleHeight, this.spnScale]; }, afterRender: function() { diff --git a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js index 00a9bf28f..2fa63e9f7 100644 --- a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js @@ -49,8 +49,7 @@ define([ SSE.Views.ValueFieldSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ options: { contentWidth: 284, - height: 220, - focusManager: true + height: 220 }, initialize : function(options) { @@ -194,12 +193,15 @@ define([ this.afterRender(); - this.focusManager.add([this.inputCustomName, this.cmbSummarize], '.form-control'); setTimeout(function(){ me.inputCustomName.focus(); },100); }, + getFocusedComponents: function() { + return [this.inputCustomName, this.cmbSummarize]; + }, + afterRender: function() { this._setDefaults(this.props); },