diff --git a/apps/presentationeditor/main/app/view/ChartSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ChartSettingsAdvanced.js index fb0e919fa..5b5a0155a 100644 --- a/apps/presentationeditor/main/app/view/ChartSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ChartSettingsAdvanced.js @@ -104,6 +104,25 @@ define([ 'text!presentationeditor/main/app/template/ChartSettingsAdvanced.tem } }, + getFocusedComponents: function() { + return [ + this.inputAltTitle, this.textareaAltDescription // 0 tab + ]; + }, + + onCategoryClick: function(btn, index) { + Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index); + + var me = this; + setTimeout(function(){ + switch (index) { + case 0: + me.inputAltTitle.focus(); + break; + } + }, 10); + }, + _setDefaults: function(props) { if (props ){ var value = props.asc_getTitle(); diff --git a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js index 8a320ebf4..97584dcf0 100644 --- a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js +++ b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js @@ -138,7 +138,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', editable : false, data : data, search: true, - scrollAlwaysVisible: true + scrollAlwaysVisible: true, + takeFocusOnClose: true }); this.cmbLang.setValue(0x0409); this.cmbLang.on('selected', _.bind(function(combo, record) { @@ -151,7 +152,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', menuStyle : 'min-width: 100%; max-height: 185px;', cls : 'input-group-nr', editable : false, - data : [] + data : [], + takeFocusOnClose: true }); this.dateControls.push(this.cmbFormat); @@ -185,6 +187,27 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', this.afterRender(); }, + getFocusedComponents: function() { + return [ this.cmbFormat, this.cmbLang, this.inputFixed, this.inputFooter ]; + }, + + focusControls: function() { + var me = this; + setTimeout(function(){ + if (!me.cmbFormat.isDisabled()) + me.cmbFormat.focus(); + else if (!me.inputFixed.isDisabled()) + me.inputFixed.focus(); + else if (!me.inputFooter.isDisabled()) + me.inputFooter.focus(); + }, 10); + }, + + show: function() { + Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); + this.focusControls(); + }, + afterRender: function() { var me = this, value = Common.Utils.InternalSettings.get("pe-settings-datetime-default"), @@ -207,6 +230,7 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', }); newValue && this.setDateTimeType(this.radioFixed.getValue() ? 'fixed' : 'update', null, true); this.props.put_ShowDateTime(newValue); + this.focusControls(); } else if (type == 'slide') { this.props.put_ShowSlideNum(newValue); } else if (type == 'footer') { @@ -243,10 +267,7 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template', this.cmbLang.setDisabled(type == 'fixed'); this.cmbFormat.setDisabled(type == 'fixed'); this.inputFixed.setDisabled(type == 'update'); - (type == 'fixed') && setTimeout(function(){ - me.inputFixed.cmpEl.find('input').focus(); - },50); - + this.focusControls(); } }, diff --git a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js index fdbd5f777..7caa13da0 100644 --- a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js @@ -220,6 +220,33 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem this.afterRender(); }, + getFocusedComponents: function() { + return [ + this.spnWidth, this.spnHeight, this.spnX, this.spnY,// 0 tab + this.spnAngle, // 1 tab + this.inputAltTitle, this.textareaAltDescription // 2 tab + ]; + }, + + onCategoryClick: function(btn, index) { + Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index); + + var me = this; + setTimeout(function(){ + switch (index) { + case 0: + me.spnWidth.focus(); + break; + case 1: + me.spnAngle.focus(); + break; + case 2: + me.inputAltTitle.focus(); + break; + } + }, 10); + }, + afterRender: function() { this.updateMetricUnit(); this._setDefaults(this._originalProps); diff --git a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js index 21d23d1a8..7d772dc4e 100644 --- a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js @@ -127,7 +127,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced editable: false, data: this._arrTextAlignment, style: 'width: 173px;', - menuStyle : 'min-width: 173px;' + menuStyle : 'min-width: 173px;', + takeFocusOnClose: true }); this.cmbTextAlignment.setValue(''); @@ -176,7 +177,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced editable: false, data: this._arrSpecial, style: 'width: 85px;', - menuStyle : 'min-width: 85px;' + menuStyle : 'min-width: 85px;', + takeFocusOnClose: true }); this.cmbSpecial.setValue(''); this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this)); @@ -240,7 +242,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced editable: false, data: this._arrLineRule, style: 'width: 85px;', - menuStyle : 'min-width: 85px;' + menuStyle : 'min-width: 85px;', + takeFocusOnClose: true }); this.cmbLineRule.setValue(this.CurLineRuleIdx); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); @@ -355,7 +358,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced '