Merge pull request #534 from ONLYOFFICE/feature/focus-manager

Feature/focus manager
Bug 27088, Bug 28317, Bug 34046, Bug 46575, Bug 46574, Bug 46636
This commit is contained in:
Julia Radzhabova 2020-10-23 11:33:21 +03:00 committed by GitHub
commit 840d6b5d86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 1586 additions and 331 deletions

View file

@ -237,7 +237,7 @@ define([
me.yearPicker.store.reset(arrYears); me.yearPicker.store.reset(arrYears);
me.enableKeyEvents && _.delay(function() { me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus(); me.monthPicker.focus();
}, 10); }, 10);
}, },
@ -312,7 +312,7 @@ define([
me.monthsPicker.store.reset(arrMonths); me.monthsPicker.store.reset(arrMonths);
me.enableKeyEvents && _.delay(function() { me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus(); me.monthPicker.focus();
}, 10); }, 10);
}, },
@ -435,7 +435,7 @@ define([
me.monthPicker.store.reset(arrDays); me.monthPicker.store.reset(arrDays);
me.enableKeyEvents && _.delay(function() { me.enableKeyEvents && _.delay(function() {
me.monthPicker.cmpEl.find('.dataview').focus(); me.monthPicker.focus();
}, 10); }, 10);
}, },

View file

@ -86,7 +86,8 @@ define([
displayField: 'displayValue', displayField: 'displayValue',
valueField : 'value', valueField : 'value',
search : false, search : false,
scrollAlwaysVisible: false scrollAlwaysVisible: false,
takeFocusOnClose: false
}, },
template: _.template([ template: _.template([
@ -320,6 +321,9 @@ define([
$list.scrollTop(height); $list.scrollTop(height);
} }
setTimeout(function(){$selected.find('a').focus();}, 1); setTimeout(function(){$selected.find('a').focus();}, 1);
} else {
var me = this;
setTimeout(function(){me.cmpEl.find('ul li:first a').focus();}, 1);
} }
if (this.scroller) if (this.scroller)
@ -340,10 +344,19 @@ define([
this.cmpEl.find('.dropdown-toggle').blur(); this.cmpEl.find('.dropdown-toggle').blur();
this.trigger('hide:after', this, e, isFromInputControl); this.trigger('hide:after', this, e, isFromInputControl);
Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl); Common.NotificationCenter.trigger('menu:hide', this, isFromInputControl);
if (this.options.takeFocusOnClose) {
var me = this;
setTimeout(function(){me.focus();}, 1);
}
}, },
onAfterKeydownMenu: function(e) { onAfterKeydownMenu: function(e) {
if (e.keyCode == Common.UI.Keys.RETURN) { if (e.keyCode == Common.UI.Keys.DOWN && !this.editable && !this.isMenuOpen()) {
this.openMenu();
this.onAfterShowMenu();
return false;
}
else if (e.keyCode == Common.UI.Keys.RETURN && (this.editable || this.isMenuOpen())) {
$(e.target).click(); $(e.target).click();
var me = this; var me = this;
if (this.rendered) { if (this.rendered) {
@ -663,6 +676,10 @@ define([
wheelSpeed: 10, wheelSpeed: 10,
alwaysVisibleY: this.scrollAlwaysVisible alwaysVisibleY: this.scrollAlwaysVisible
}, this.options.scroller)); }, this.options.scroller));
},
focus: function() {
this._input && this._input.focus();
} }
} }
})()); })());
@ -684,6 +701,10 @@ define([
Common.UI.ComboBox.prototype.selectRecord.call(this, record); Common.UI.ComboBox.prototype.selectRecord.call(this, record);
if (this.options.updateFormControl) if (this.options.updateFormControl)
this.options.updateFormControl.call(this, this._selectedItem); this.options.updateFormControl.call(this, this._selectedItem);
},
focus: function() {
this.cmpEl && this.cmpEl.find('.form-control').focus();
} }
}, Common.UI.ComboBoxCustom || {})); }, Common.UI.ComboBoxCustom || {}));
}); });

View file

@ -105,14 +105,17 @@ define([
render : function(parentEl) { render : function(parentEl) {
var oldRawValue = null; var oldRawValue = null;
var oldTabindex = '';
if (!_.isUndefined(this._input)) { if (!_.isUndefined(this._input)) {
oldRawValue = this._input.val(); oldRawValue = this._input.val();
oldTabindex = this._input.attr('tabindex');
} }
Common.UI.ComboBox.prototype.render.call(this, parentEl); Common.UI.ComboBox.prototype.render.call(this, parentEl);
this.setRawValue(oldRawValue); this.setRawValue(oldRawValue);
this._input.attr('tabindex', oldTabindex);
this._input.on('keyup', _.bind(this.onInputKeyUp, this)); this._input.on('keyup', _.bind(this.onInputKeyUp, this));
this._input.on('keydown', _.bind(this.onInputKeyDown, this)); this._input.on('keydown', _.bind(this.onInputKeyDown, this));
@ -199,7 +202,7 @@ define([
me.closeMenu(); me.closeMenu();
me.onAfterHideMenu(e); me.onAfterHideMenu(e);
}, 10); }, 10);
} else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT){ } else if (e.keyCode != Common.UI.Keys.RETURN && e.keyCode != Common.UI.Keys.CTRL && e.keyCode != Common.UI.Keys.SHIFT && e.keyCode != Common.UI.Keys.ALT && e.keyCode != Common.UI.Keys.TAB){
if (!this.isMenuOpen() && !e.ctrlKey) if (!this.isMenuOpen() && !e.ctrlKey)
this.openMenu(); this.openMenu();

View file

@ -242,6 +242,7 @@ define([
me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true; me.listenStoreEvents= (me.options.listenStoreEvents!==undefined) ? me.options.listenStoreEvents : true;
me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true; me.allowScrollbar = (me.options.allowScrollbar!==undefined) ? me.options.allowScrollbar : true;
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false; me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0;
if (me.parentMenu) if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0); me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false; me.rendered = false;
@ -678,7 +679,7 @@ define([
if (this.enableKeyEvents && this.handleSelect) { if (this.enableKeyEvents && this.handleSelect) {
var el = $(this.el).find('.inner').addBack().filter('.inner'); var el = $(this.el).find('.inner').addBack().filter('.inner');
el.addClass('canfocused'); el.addClass('canfocused');
el.attr('tabindex', '0'); el.attr('tabindex', this.tabindex.toString());
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this)); el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
} }
}, },
@ -763,6 +764,10 @@ define([
onResize: function() { onResize: function() {
this._layoutParams = undefined; this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
} }
}); });
@ -798,6 +803,8 @@ define([
me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu me.useBSKeydown = me.options.useBSKeydown; // only with enableKeyEvents && parentMenu
me.style = me.options.style || ''; me.style = me.options.style || '';
me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false; me.scrollAlwaysVisible = me.options.scrollAlwaysVisible || false;
me.tabindex = me.options.tabindex || 0;
if (me.parentMenu) if (me.parentMenu)
me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0); me.parentMenu.options.restoreHeight = (me.options.restoreHeight>0);
me.rendered = false; me.rendered = false;
@ -1120,7 +1127,7 @@ define([
if (this.enableKeyEvents && this.handleSelect) { if (this.enableKeyEvents && this.handleSelect) {
var el = $(this.el).find('.inner').addBack().filter('.inner'); var el = $(this.el).find('.inner').addBack().filter('.inner');
el.addClass('canfocused'); el.addClass('canfocused');
el.attr('tabindex', '0'); el.attr('tabindex', this.tabindex.toString());
el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this)); el.on((this.parentMenu && this.useBSKeydown) ? 'dataview:keydown' : 'keydown', _.bind(this.onKeyDown, this));
} }
}, },
@ -1192,6 +1199,10 @@ define([
onResize: function() { onResize: function() {
this._layoutParams = undefined; this._layoutParams = undefined;
},
focus: function() {
this.cmpEl && this.cmpEl.find('.dataview').focus();
} }
}); });

View file

@ -0,0 +1,173 @@
/*
*
* (c) Copyright Ascensio System SIA 2010-2020
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* FocusManager.js
*
* Created by Julia Radzhabova on 24.09.2020
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
*
*/
if (Common === undefined)
var Common = {};
if (Common.UI === undefined) {
Common.UI = {};
}
Common.UI.FocusManager = new(function() {
var _tabindex = 1,
_windows = [],
_count = 0;
var register = function(fields) {
var arr = [];
if (!fields.forEach) {
fields = [fields];
}
fields.forEach(function(field) {
if (field) {
var item = (field.cmp && typeof field.selector == 'string') ? field : {cmp: field, selector: '.form-control'};
item.el = (item.cmp.$el || $(item.cmp.el || item.cmp)).find(item.selector).addBack().filter(item.selector);
item.el && item.el.attr && item.el.attr('tabindex', _tabindex.toString());
arr.push(item);
}
});
return arr;
};
var addTraps = function(current) {
if (!current || current.traps || !current.fields || current.fields.length<1) return;
var trapFirst = $('<span aria-hidden="true" tabindex="' + _tabindex + '"></span>');
trapFirst.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=0; i<fields.length; i++) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el.focus();
break;
}
}
});
current.parent.$window.prepend(trapFirst);
var trapLast = $('<span aria-hidden="true" tabindex="' + (_tabindex+1) + '"></span>');
trapLast.on('focus', function() {
if (current.hidden) return;
var fields = current.fields;
for (var i=fields.length-1; i>=0; i--) {
var field = fields[i];
if ((field.cmp.isVisible ? field.cmp.isVisible() : field.cmp.is(':visible')) && !(field.cmp.isDisabled && field.cmp.isDisabled())) {
var el = (field.selector) ? (field.cmp.$el || $(field.cmp.el || field.cmp)).find(field.selector).addBack().filter(field.selector) : field.el;
el.focus();
break;
}
}
});
current.parent.$window.append(trapLast);
current.traps = [trapFirst, trapLast];
};
var updateTabIndexes = function(increment) {
var step = increment ? 1 : -1;
for (var cid in _windows) {
if (_windows.hasOwnProperty(cid)) {
var item = _windows[cid];
if (item && item.index < _count-1 && item.traps)
item.traps[1].attr('tabindex', (parseInt(item.traps[1].attr('tabindex')) + step).toString());
}
}
};
var _add = function(e, fields) {
if (e && e.cid) {
if (_windows[e.cid]) {
_windows[e.cid].fields = (_windows[e.cid].fields || []).concat(register(fields));
} else {
_windows[e.cid] = {
parent: e,
fields: register(fields),
hidden: false,
index: _count++
};
}
addTraps(_windows[e.cid]);
}
};
Common.NotificationCenter.on({
'modal:show': function(e){
if (e && e.cid) {
if (_windows[e.cid]) {
_windows[e.cid].hidden = false;
} else {
_windows[e.cid] = {
parent: e,
hidden: false,
index: _count++
};
updateTabIndexes(true);
}
}
},
'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]);
}
var el = e ? e.getDefaultFocusableComponent() : null;
el && setTimeout(function(){ el.focus(); }, 100);
},
'modal:close': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
updateTabIndexes(false);
delete _windows[e.cid];
_count--;
}
},
'modal:hide': function(e, last) {
if (e && e.cid && _windows[e.cid]) {
_windows[e.cid].hidden = true;
}
}
});
return {
add: _add
}
})();

View file

@ -300,7 +300,7 @@ define([
}, },
focus: function() { focus: function() {
this._input.focus(); this._input && this._input.focus();
}, },
checkValidate: function() { checkValidate: function() {

View file

@ -115,6 +115,10 @@ define([
if (!this.isSuspendEvents) if (!this.isSuspendEvents)
this.trigger('item:add', this, view, record); this.trigger('item:add', this, view, record);
} }
},
focus: function() {
this.cmpEl && this.cmpEl.find('.listview').focus();
} }
} }
})()); })());

View file

@ -537,6 +537,10 @@ define([
v_out = parseFloat((v_out * 6.0 / 25.4).toFixed(6)); v_out = parseFloat((v_out * 6.0 / 25.4).toFixed(6));
return v_out; return v_out;
},
focus: function() {
if (this.$input) this.$input.focus();
} }
}); });

View file

@ -159,11 +159,12 @@ define([
showLast: true, showLast: true,
allowScrollbar: true, allowScrollbar: true,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
emptyItemText: '' emptyItemText: '',
keyMoveDirection: 'both'
}, },
template: _.template([ template: _.template([
'<div class="treeview inner"></div>' '<div class="treeview inner" style="<%= style %>"></div>'
].join('')), ].join('')),
initialize : function(options) { initialize : function(options) {
@ -280,6 +281,86 @@ define([
this.store.collapseSubItems(record); this.store.collapseSubItems(record);
this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible}); this.scroller.update({minScrollbarLength: 40, alwaysVisibleY: this.scrollAlwaysVisible});
} }
},
onKeyDown: function (e, data) {
if ( this.disabled ) return;
if (data===undefined) data = e;
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
data.preventDefault();
data.stopPropagation();
var rec = this.getSelectedRec();
if (this.lastSelectedRec===null)
this.lastSelectedRec = rec;
if (data.keyCode==Common.UI.Keys.RETURN) {
this.lastSelectedRec = null;
if (this.selectedBeforeHideRec) // only for ComboDataView menuPicker
rec = this.selectedBeforeHideRec;
this.trigger('item:click', this, this, rec, e);
this.trigger('item:select', this, this, rec, e);
this.trigger('entervalue', this, rec, e);
if (this.parentMenu)
this.parentMenu.hide();
} else {
var idx = _.indexOf(this.store.models, rec);
if (idx<0) {
if (data.keyCode==Common.UI.Keys.LEFT) {
var target = $(e.target).closest('.dropdown-submenu.over');
if (target.length>0) {
target.removeClass('over');
target.find('> a').focus();
} else
idx = 0;
} else
idx = 0;
} else if (this.options.keyMoveDirection == 'both') {
var hasSubItems = rec.get('hasSubItems');
var hasParent = rec.get('hasParent');
var isExpanded = rec.get('isExpanded');
if (data.keyCode==Common.UI.Keys.LEFT) {
if (hasSubItems && isExpanded)
this.collapseRecord(rec);
} else if (data.keyCode==Common.UI.Keys.RIGHT) {
if (hasSubItems && !isExpanded)
this.expandRecord(rec);
} else {
if (data.keyCode==Common.UI.Keys.DOWN) {
for (var i=idx+1; i<this.store.length; i++) {
if (this.store.at(i).get('isVisible')) {
idx=i;
break;
}
}
} else if (data.keyCode==Common.UI.Keys.UP) {
for (var i=idx-1; i>=0; i--) {
if (this.store.at(i).get('isVisible')) {
idx=i;
break;
}
}
}
}
} else {
idx = (data.keyCode==Common.UI.Keys.UP || data.keyCode==Common.UI.Keys.LEFT)
? Math.max(0, idx-1)
: Math.min(this.store.length - 1, idx + 1) ;
}
if (idx !== undefined && idx>=0) rec = this.store.at(idx);
if (rec) {
this._fromKeyDown = true;
this.selectRecord(rec);
this._fromKeyDown = false;
this.scrollToRecord(rec);
}
}
} else {
this.trigger('item:keydown', this, rec, e);
}
},
focus: function() {
this.cmpEl && this.cmpEl.find('.treeview').focus();
} }
} }
})()); })());

View file

@ -137,7 +137,8 @@
define([ define([
'common/main/lib/component/BaseView', 'common/main/lib/component/BaseView',
'common/main/lib/component/CheckBox' 'common/main/lib/component/CheckBox',
'common/main/lib/component/FocusManager'
], function () { ], function () {
'use strict'; 'use strict';
@ -778,7 +779,7 @@ define([
this.fireEvent('show', this); this.fireEvent('show', this);
} }
Common.NotificationCenter.trigger('window:show'); Common.NotificationCenter.trigger('window:show', this);
}, },
close: function(suppressevent) { close: function(suppressevent) {
@ -984,6 +985,13 @@ define([
onPrimary: function() {}, onPrimary: function() {},
getFocusedComponents: function() {
return [];
},
getDefaultFocusableComponent: function() {
},
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
okButtonText: 'OK', okButtonText: 'OK',
yesButtonText: 'Yes', yesButtonText: 'Yes',

View file

@ -96,7 +96,7 @@ define([
allowDepress: false, allowDepress: false,
contentTarget: btnEl.attr('content-target') contentTarget: btnEl.attr('content-target')
}); });
btn.on('click', _.bind(me.onCategoryClick, me)); btn.on('click', _.bind(me.onCategoryClick, me, btn, index));
me.btnsCategory.push(btn); me.btnsCategory.push(btn);
}); });
var cnt_panel = $window.find('.content-panel'), var cnt_panel = $window.find('.content-panel'),
@ -125,7 +125,7 @@ define([
this.close(); this.close();
}, },
onCategoryClick: function(btn, event) { onCategoryClick: function(btn, index) {
this.content_panels.filter('.active').removeClass('active'); this.content_panels.filter('.active').removeClass('active');
$("#" + btn.options.contentTarget).addClass("active"); $("#" + btn.options.contentTarget).addClass("active");
}, },
@ -144,19 +144,21 @@ define([
setActiveCategory: function(index) { setActiveCategory: function(index) {
if (this.btnsCategory.length<1) return; if (this.btnsCategory.length<1) return;
var btnActive = this.btnsCategory[(index>=0 && index<this.btnsCategory.length) ? index : 0]; index = (index>=0 && index<this.btnsCategory.length) ? index : 0;
var btnActive = this.btnsCategory[index];
if (!btnActive.isVisible() || btnActive.isDisabled()) { if (!btnActive.isVisible() || btnActive.isDisabled()) {
for (var i = 0; i<this.btnsCategory.length; i++){ for (var i = 0; i<this.btnsCategory.length; i++){
var btn = this.btnsCategory[i]; var btn = this.btnsCategory[i];
if (btn.isVisible() && !btn.isDisabled()) { if (btn.isVisible() && !btn.isDisabled()) {
btnActive = btn; btnActive = btn;
index = i;
break; break;
} }
} }
} }
btnActive.toggle(true); btnActive.toggle(true);
this.onCategoryClick(btnActive); this.onCategoryClick(btnActive, index);
}, },
getActiveCategory: function() { getActiveCategory: function() {

View file

@ -177,7 +177,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
'<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>', '<div style="flex-grow:1;font-family: Cambria Math;font-size:13px;<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= by %></div>',
'</div>' '</div>'
].join('')), ].join('')),
scrollAlwaysVisible: true scrollAlwaysVisible: true,
tabindex: 1
}); });
this.mathList.on('item:select', _.bind(this.onSelectMathItem, this)); this.mathList.on('item:select', _.bind(this.onSelectMathItem, this));
@ -215,7 +216,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.mathList.scrollToRecord(_selectedItem); me.mathList.scrollToRecord(_selectedItem);
} }
_.delay(function(){ _.delay(function(){
me.mathList.cmpEl.find('.listview').focus(); me.mathList.focus();
},10); },10);
} }
@ -257,7 +258,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
itemTemplate: _.template([ itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>' '<div id="<%= id %>" class="list-item" style="<% if (defaultDisabled) { %> font-style:italic; opacity: 0.5;<% } %>"><%= value %></div>'
].join('')), ].join('')),
scrollAlwaysVisible: true scrollAlwaysVisible: true,
tabindex: 1
}); });
this.mathRecList.on('item:select', _.bind(this.onSelectRecItem, this)); this.mathRecList.on('item:select', _.bind(this.onSelectRecItem, this));
@ -295,7 +297,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
me.mathRecList.scrollToRecord(_selectedItem); me.mathRecList.scrollToRecord(_selectedItem);
} }
_.delay(function(){ _.delay(function(){
me.mathRecList.cmpEl.find('.listview').focus(); me.mathRecList.focus();
},10); },10);
} }
@ -364,6 +366,13 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
} }
}, },
getFocusedComponents: function() {
return [
this.inputReplace, this.inputBy, {cmp: this.mathList, selector: '.listview'}, // 0 tab
this.inputRecFind, {cmp: this.mathRecList, selector: '.listview'} // 1 tab
];
},
getSettings: function() { getSettings: function() {
return; return;
}, },

View file

@ -85,7 +85,6 @@ define([
defaultUnit : "", defaultUnit : "",
maxValue: 255, maxValue: 255,
minValue: 0, minValue: 0,
tabindex: 1,
maskExp: /[0-9]/, maskExp: /[0-9]/,
allowDecimal: false allowDecimal: false
}); });
@ -98,7 +97,6 @@ define([
defaultUnit : "", defaultUnit : "",
maxValue: 255, maxValue: 255,
minValue: 0, minValue: 0,
tabindex: 2,
maskExp: /[0-9]/, maskExp: /[0-9]/,
allowDecimal: false allowDecimal: false
}); });
@ -111,7 +109,6 @@ define([
defaultUnit : "", defaultUnit : "",
maxValue: 255, maxValue: 255,
minValue: 0, minValue: 0,
tabindex: 3,
maskExp: /[0-9]/, maskExp: /[0-9]/,
allowDecimal: false allowDecimal: false
}); });
@ -128,7 +125,6 @@ define([
this.spinB.on('change', _.bind(this.showColor, this, null, true)).on('changing', _.bind(this.onChangingRGB, this, 3)); this.spinB.on('change', _.bind(this.showColor, this, null, true)).on('changing', _.bind(this.onChangingRGB, this, 3));
this.textColor.on('change', _.bind(this.onChangeMaskedField, this)); this.textColor.on('change', _.bind(this.onChangeMaskedField, this));
this.textColor.on('changed', _.bind(this.onChangedMaskedField, this)); this.textColor.on('changed', _.bind(this.onChangedMaskedField, this));
this.textColor.$el.attr('tabindex', 4);
this.spinR.$el.find('input').attr('maxlength', 3); this.spinR.$el.find('input').attr('maxlength', 3);
this.spinG.$el.find('input').attr('maxlength', 3); this.spinG.$el.find('input').attr('maxlength', 3);
this.spinB.$el.find('input').attr('maxlength', 3); this.spinB.$el.find('input').attr('maxlength', 3);
@ -146,9 +142,18 @@ define([
this.rendered = true; this.rendered = true;
if (this.color!==undefined) if (this.color!==undefined)
this.setColor(this.color); this.setColor(this.color);
return this; return this;
}, },
getFocusedComponents: function() {
return [this.spinR, this.spinG, this.spinB, {cmp: this.textColor, selector: 'input'}];
},
getDefaultFocusableComponent: function () {
return this.getChild('#extended-text-color');
},
onChangeColor: function(o, color) { onChangeColor: function(o, color) {
this.colorNew.css({'background-color' : color}); this.colorNew.css({'background-color' : color});
@ -271,15 +276,6 @@ define([
me.stopevents = false; me.stopevents = false;
}, },
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.getChild('#extended-text-color').focus();
},50);
},
onPrimary: function() { onPrimary: function() {
this.trigger('onmodalresult', 1); this.trigger('onmodalresult', 1);
this.close(true); this.close(true);

View file

@ -107,6 +107,14 @@ define([
// this.udRows.on('entervalue', _.bind(this.onPrimary, this)); // this.udRows.on('entervalue', _.bind(this.onPrimary, this));
}, },
getFocusedComponents: function() {
return [this.udColumns, this.udRows];
},
getDefaultFocusableComponent: function () {
return this.udColumns;
},
onBtnClick: function(event) { onBtnClick: function(event) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, event.currentTarget.attributes['result'].value, { this.options.handler.call(this, event.currentTarget.attributes['result'].value, {

View file

@ -101,7 +101,9 @@ define([
'</span>' '</span>'
].join('')), ].join('')),
data: this.options.languages, data: this.options.languages,
search: true takeFocusOnClose: true,
search: true,
scrollAlwaysVisible: true
}); });
if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true}); if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true});
@ -109,6 +111,11 @@ define([
var langname = Common.util.LanguageInfo.getLocalLanguageName(this.options.current); var langname = Common.util.LanguageInfo.getLocalLanguageName(this.options.current);
this.cmbLanguage.setValue(langname[0], langname[1]); this.cmbLanguage.setValue(langname[0], langname[1]);
this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord()); this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord());
var me = this;
setTimeout(function(){
me.cmbLanguage.focus();
}, 100);
}, },
close: function(suppressevent) { close: function(suppressevent) {

View file

@ -155,6 +155,7 @@ define([
el : $('#id-dlg-list-numbering-format'), el : $('#id-dlg-list-numbering-format'),
menuStyle : 'min-width: 100%;max-height: 183px;', menuStyle : 'min-width: 100%;max-height: 183px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ displayValue: this.txtNone, value: -1 }, { displayValue: this.txtNone, value: -1 },
@ -196,6 +197,7 @@ define([
menuStyle : 'min-width: 100%;max-height: 183px;', menuStyle : 'min-width: 100%;max-height: 183px;',
style : "width: 100px;", style : "width: 100px;",
editable : false, editable : false,
takeFocusOnClose: true,
template : _.template(template.join('')), template : _.template(template.join('')),
itemsTemplate: _.template(itemsTemplate.join('')), itemsTemplate: _.template(itemsTemplate.join('')),
data : [ data : [
@ -318,6 +320,10 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.cmbNumFormat, this.cmbBulletFormat, this.spnSize, this.spnStart];
},
afterRender: function() { afterRender: function() {
this.updateThemeColors(); this.updateThemeColors();
this._setDefaults(this.props); this._setDefaults(this.props);
@ -342,6 +348,13 @@ define([
this.numberingControls.toggleClass('hidden', value==0); this.numberingControls.toggleClass('hidden', value==0);
this.cmbNumFormat.setVisible(value==1); this.cmbNumFormat.setVisible(value==1);
this.cmbBulletFormat.setVisible(value==0); this.cmbBulletFormat.setVisible(value==0);
var me = this;
_.delay(function(){
if (value)
me.cmbNumFormat.focus();
else
me.cmbBulletFormat.focus();
},50);
}, },
_handleInput: function(state) { _handleInput: function(state) {

View file

@ -1482,7 +1482,7 @@ define([
this.specialPanel.toggleClass('hidden', !special); this.specialPanel.toggleClass('hidden', !special);
var me = this; var me = this;
_.delay(function(){ _.delay(function(){
special ? me.specialList.cmpEl.find('.listview').focus() : me.previewPanel.focus(); special ? me.specialList.focus() : me.previewPanel.focus();
},50); },50);
}, },

View file

@ -1,5 +1,6 @@
.listview { .listview {
border: 1px solid @input-border; border: 1px solid @input-border;
.border-radius(@border-radius-small);
line-height: 15px; line-height: 15px;
&.inner { &.inner {
@ -20,6 +21,10 @@
} }
} }
&:not(.no-focus):focus {
border-color: @gray-darker;
}
& > .item { & > .item {
// display: block; // display: block;
text-overflow: ellipsis; text-overflow: ellipsis;

View file

@ -1,4 +1,7 @@
.treeview { .treeview {
border: 1px solid @input-border;
.border-radius(@border-radius-small);
&.inner { &.inner {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -16,6 +19,10 @@
} }
} }
&:focus {
border-color: @gray-darker;
}
> .item { > .item {
display: block; display: block;
width: 100%; width: 100%;

View file

@ -173,6 +173,7 @@ define([
this.bookmarksList = new Common.UI.ListView({ this.bookmarksList = new Common.UI.ListView({
el: $('#bookmarks-list', this.$window), el: $('#bookmarks-list', this.$window),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;"><%= value %></div>') itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;"><%= value %></div>')
}); });
this.bookmarksList.store.comparator = function(rec) { this.bookmarksList.store.comparator = function(rec) {
@ -247,6 +248,10 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.txtName, {cmp: this.bookmarksList, selector: '.listview'}];
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
var me = this; var me = this;
@ -349,6 +354,7 @@ define([
var rec = this.bookmarksList.store.findWhere({value: this.txtName.getValue()}); var rec = this.bookmarksList.store.findWhere({value: this.txtName.getValue()});
this.bookmarksList.selectRecord(rec); this.bookmarksList.selectRecord(rec);
this.bookmarksList.scrollToRecord(rec); this.bookmarksList.scrollToRecord(rec);
this.txtName.focus();
}, },
onDblClickBookmark: function(listView, itemView, record) { onDblClickBookmark: function(listView, itemView, record) {

View file

@ -152,6 +152,7 @@ define([
menuStyle: 'min-width: 75px;', menuStyle: 'min-width: 75px;',
editable: false, editable: false,
disabled: !this.isObject, disabled: !this.isObject,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: this.textBefore, value: 1 }, { displayValue: this.textBefore, value: 1 },
{ displayValue: this.textAfter, value: 0 } { displayValue: this.textAfter, value: 0 }
@ -180,6 +181,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 160px;max-height:155px;', menuStyle: 'min-width: 160px;max-height:155px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: this.arrLabel, data: this.arrLabel,
alwaysVisibleY: true alwaysVisibleY: true
}); });
@ -264,6 +266,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 160px;', menuStyle: 'min-width: 160px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 }, { displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 },
{ displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' }, { displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' },
@ -305,6 +308,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 160px;max-height:135px;', menuStyle: 'min-width: 160px;max-height:135px;',
editable: false, editable: false,
takeFocusOnClose: true,
disabled: true, disabled: true,
data: this._arrLevel data: this._arrLevel
}); });
@ -320,6 +324,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 160px;', menuStyle: 'min-width: 160px;',
editable: false, editable: false,
takeFocusOnClose: true,
disabled: true, disabled: true,
data: [ data: [
{ displayValue: '- (' + this.textHyphen + ')', value: '-' }, { displayValue: '- (' + this.textHyphen + ')', value: '-' },
@ -341,12 +346,16 @@ define([
this.afterRender(); this.afterRender();
}, },
afterRender: function() { getFocusedComponents: function() {
this._setDefaults(this.props); return [this.txtCaption, this.cmbPosition, this.cmbLabel, this.cmbNumbering, this.cmbChapter, this.cmbSeparator];
}, },
show: function() { getDefaultFocusableComponent: function () {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); return this.txtCaption;
},
afterRender: function() {
this._setDefaults(this.props);
}, },
close: function() { close: function() {

View file

@ -85,6 +85,7 @@ define([
style: 'width: 110px;', style: 'width: 110px;',
menuStyle: 'min-width: 110px;', menuStyle: 'min-width: 110px;',
editable: false, editable: false,
takeFocusOnClose: true,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data: [ data: [
{ value: 0, displayValue: this.textRow}, { value: 0, displayValue: this.textRow},
@ -128,6 +129,14 @@ define([
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
}, },
getFocusedComponents: function() {
return [this.cmbRowCol, this.spnCount];
},
getDefaultFocusableComponent: function () {
return this.spnCount;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, state, this.getSettings()); this.options.handler.call(this, state, this.getSettings());

View file

@ -120,6 +120,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 120px;', menuStyle: 'min-width: 120px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: this.textBox, value: Asc.c_oAscSdtAppearance.Frame }, { displayValue: this.textBox, value: Asc.c_oAscSdtAppearance.Frame },
{ displayValue: this.textNone, value: Asc.c_oAscSdtAppearance.Hidden } { displayValue: this.textNone, value: Asc.c_oAscSdtAppearance.Hidden }
@ -168,7 +169,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
'<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;margin-right: 5px;"><%= name %></div>', '<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;margin-right: 5px;"><%= name %></div>',
'<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= value %></div>', '<div style="width:90px;display: inline-block;vertical-align: middle; overflow: hidden; text-overflow: ellipsis;white-space: pre;"><%= value %></div>',
'</div>' '</div>'
].join('')) ].join('')),
tabindex: 1
}); });
this.list.on('item:select', _.bind(this.onSelectItem, this)); this.list.on('item:select', _.bind(this.onSelectItem, this));
@ -212,7 +214,10 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
menuStyle : 'min-width: 100%; max-height: 185px;', menuStyle : 'min-width: 100%; max-height: 185px;',
cls : 'input-group-nr', cls : 'input-group-nr',
editable : false, editable : false,
data : data takeFocusOnClose: true,
data : data,
search: true,
scrollAlwaysVisible: true
}); });
this.cmbLang.setValue(0x0409); this.cmbLang.setValue(0x0409);
this.cmbLang.on('selected',function(combo, record) { this.cmbLang.on('selected',function(combo, record) {
@ -222,7 +227,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
this.listFormats = new Common.UI.ListView({ this.listFormats = new Common.UI.ListView({
el: $('#control-settings-format'), el: $('#control-settings-format'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
scrollAlwaysVisible: true scrollAlwaysVisible: true,
tabindex: 1
}); });
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this)); this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
@ -346,6 +352,28 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.txtName, this.txtTag, this.txtPlaceholder, this.cmbShow, // 0 tab
{cmp: this.list, selector: '.listview'}, // 2 tab
this.txtDate, {cmp: this.listFormats, selector: '.listview'}, this.cmbLang // 3 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
if (index==0) {
me.txtName.focus();
} else if (index==2) {
me.list.focus();
} else if (index==3)
me.txtDate.focus();
}, 100);
},
onColorsSelect: function(btn, color) { onColorsSelect: function(btn, color) {
var clr_item = this.btnColor.menu.$el.find('#control-settings-system-color > a'); var clr_item = this.btnColor.menu.$el.find('#control-settings-system-color > a');
clr_item.hasClass('selected') && clr_item.removeClass('selected'); clr_item.hasClass('selected') && clr_item.removeClass('selected');
@ -679,7 +707,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
me.disableListButtons(); me.disableListButtons();
} }
} }
me.list.cmpEl.find('.listview').focus(); me.list.focus();
} }
}); });
win.show(); win.show();
@ -699,7 +727,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
}); });
} }
} }
me.list.cmpEl.find('.listview').focus(); me.list.focus();
} }
}); });
rec && win.show(); rec && win.show();
@ -719,7 +747,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
} }
} }
this.disableListButtons(); this.disableListButtons();
this.list.cmpEl.find('.listview').focus(); this.list.focus();
}, },
onMoveItem: function(up) { onMoveItem: function(up) {
@ -732,7 +760,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
this.list.selectRecord(rec); this.list.selectRecord(rec);
this.list.scrollToRecord(rec); this.list.scrollToRecord(rec);
} }
this.list.cmpEl.find('.listview').focus(); this.list.focus();
}, },
updateFormats: function(lang) { updateFormats: function(lang) {

View file

@ -130,6 +130,14 @@ define([
this.updateMetricUnit(); this.updateMetricUnit();
}, },
getFocusedComponents: function() {
return [this.spnColumns, this.spnSpacing];
},
getDefaultFocusableComponent: function () {
return this.spnColumns;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, this, state); this.options.handler.call(this, this, state);

View file

@ -102,7 +102,10 @@ define([
menuStyle : 'min-width: 100%; max-height: 185px;', menuStyle : 'min-width: 100%; max-height: 185px;',
cls : 'input-group-nr', cls : 'input-group-nr',
editable : false, editable : false,
data : data takeFocusOnClose: true,
data : data,
search: true,
scrollAlwaysVisible: true
}); });
this.cmbLang.setValue(0x0409); this.cmbLang.setValue(0x0409);
this.cmbLang.on('selected', _.bind(function(combo, record) { this.cmbLang.on('selected', _.bind(function(combo, record) {
@ -120,13 +123,13 @@ define([
this.listFormats = new Common.UI.ListView({ this.listFormats = new Common.UI.ListView({
el: $('#datetime-dlg-format'), el: $('#datetime-dlg-format'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
tabindex: 1,
scrollAlwaysVisible: true scrollAlwaysVisible: true
}); });
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this)); this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this)); this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this));
this.listFormats.on('entervalue', _.bind(this.onPrimary, this)); this.listFormats.on('entervalue', _.bind(this.onPrimary, this));
this.listFormats.$el.find('.listview').focus();
this.btnDefault = new Common.UI.Button({ this.btnDefault = new Common.UI.Button({
el: $('#datetime-dlg-default') el: $('#datetime-dlg-default')
@ -172,6 +175,14 @@ define([
this._setDefaults(); this._setDefaults();
}, },
getFocusedComponents: function() {
return [this.cmbLang, {cmp: this.listFormats, selector: '.listview'}];
},
getDefaultFocusableComponent: function () {
return this.cmbLang;
},
_setDefaults: function () { _setDefaults: function () {
this.props = new Asc.CAscDateTime(); this.props = new Asc.CAscDateTime();
if (this.lang) { if (this.lang) {

View file

@ -141,6 +141,7 @@ define([
el : $('#drop-advanced-input-bordersize'), el : $('#drop-advanced-input-bordersize'),
style : 'width: 90px;', style : 'width: 90px;',
store : new Backbone.Collection(), store : new Backbone.Collection(),
takeFocusOnClose: true,
data: [ data: [
{id: Common.UI.getId(), displayValue: this.txtNoBorders, value: 0, borderstyle: ''}, {id: Common.UI.getId(), displayValue: this.txtNoBorders, value: 0, borderstyle: ''},
{id: Common.UI.getId(), displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, {id: Common.UI.getId(), displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0},
@ -353,7 +354,8 @@ define([
menuStyle : 'min-width: 55px;max-height: 236px;', menuStyle : 'min-width: 55px;max-height: 236px;',
store : new Common.Collections.Fonts(), store : new Common.Collections.Fonts(),
recent : 0, recent : 0,
hint: this.tipFontName hint: this.tipFontName,
takeFocusOnClose: true
}) })
.on('selected', _.bind(function(combo, record) { .on('selected', _.bind(function(combo, record) {
if (me._changedProps) { if (me._changedProps) {
@ -418,6 +420,7 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 130px;', menuStyle : 'min-width: 130px;',
editable : false, editable : false,
takeFocusOnClose: true,
data : this._arrWidth data : this._arrWidth
}) })
.on('selected', _.bind(function(combo, record) { .on('selected', _.bind(function(combo, record) {
@ -457,6 +460,7 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 130px;', menuStyle : 'min-width: 130px;',
editable : false, editable : false,
takeFocusOnClose: true,
data : this._arrHeight data : this._arrHeight
}) })
.on('selected', _.bind(function(combo, record) { .on('selected', _.bind(function(combo, record) {
@ -539,7 +543,8 @@ define([
el : $('#frame-advanced-input-hposition'), el : $('#frame-advanced-input-hposition'),
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 130px;', menuStyle : 'min-width: 130px;',
data : this._arrHAlign data : this._arrHAlign,
takeFocusOnClose: true
}) })
.on('changed:after', _.bind(function(combo, record) { .on('changed:after', _.bind(function(combo, record) {
if (me._changedProps) { if (me._changedProps) {
@ -564,7 +569,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 95px;', menuStyle : 'min-width: 95px;',
data : this._arrHRelative, data : this._arrHRelative,
editable : false editable : false,
takeFocusOnClose: true
}) })
.on('selected', _.bind(function(combo, record) { .on('selected', _.bind(function(combo, record) {
if (me._changedProps) { if (me._changedProps) {
@ -582,7 +588,8 @@ define([
el : $('#frame-advanced-input-vposition'), el : $('#frame-advanced-input-vposition'),
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 130px;', menuStyle : 'min-width: 130px;',
data : this._arrVAlign data : this._arrVAlign,
takeFocusOnClose: true
}) })
.on('changed:after', _.bind(function(combo, record) { .on('changed:after', _.bind(function(combo, record) {
if (me._changedProps) { if (me._changedProps) {
@ -607,7 +614,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 95px;', menuStyle : 'min-width: 95px;',
data : this._arrVRelative, data : this._arrVRelative,
editable : false editable : false,
takeFocusOnClose: true
}) })
.on('selected', _.bind(function(combo, record) { .on('selected', _.bind(function(combo, record) {
if (me._changedProps) { if (me._changedProps) {
@ -687,6 +695,28 @@ define([
} }
}, },
getFocusedComponents: function() {
return [
this.cmbWidth, this.spnWidth, this.cmbHeight, this.spnHeight, this.cmbHAlign, this.cmbHRelative, this.spnX, this.cmbVAlign, this.cmbVRelative, this.spnY, // 0 tab
this.cmbFonts, this.spnRowHeight, this.numDistance, // 1 tab
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight // 3 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
if (index==0) {
me.cmbWidth.focus();
} else if (index==1) {
me.cmbFonts.focus();
} else if (index==3)
me.spnMarginTop.focus();
}, 100);
},
getSettings: function() { getSettings: function() {
if (this.ChangedBorders === null) { if (this.ChangedBorders === null) {
this._changedProps.put_Borders(this.Borders); this._changedProps.put_Borders(this.Borders);

View file

@ -125,13 +125,12 @@ define([
$window.find('.btn').on('click', _.bind(this.onBtnClick, this)); $window.find('.btn').on('click', _.bind(this.onBtnClick, this));
}, },
show: function() { getFocusedComponents: function() {
Common.UI.Window.prototype.show.apply(this, arguments); return [this.inputName, this.inputValue];
},
var me = this; getDefaultFocusableComponent: function () {
_.delay(function(){ return this.inputName;
me.inputName.cmpEl.find('input').focus();
},50);
}, },
onPrimary: function(event) { onPrimary: function(event) {
@ -147,11 +146,11 @@ define([
if (this.options.handler) { if (this.options.handler) {
if (state == 'ok') { if (state == 'ok') {
if (this.inputName.checkValidate() !== true) { if (this.inputName.checkValidate() !== true) {
this.inputName.cmpEl.find('input').focus(); this.inputName.focus();
return; return;
} }
if (this.inputValue.checkValidate() !== true) { if (this.inputValue.checkValidate() !== true) {
this.inputValue.cmpEl.find('input').focus(); this.inputValue.focus();
return; return;
} }
} }

View file

@ -82,7 +82,7 @@ define([
'<div class="input-row">', '<div class="input-row">',
'<label>' + this.textUrl + '</label>', '<label>' + this.textUrl + '</label>',
'</div>', '</div>',
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;border: 1px solid #cfcfcf;"></div>', '<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;"></div>',
'</div>', '</div>',
'<div class="input-row">', '<div class="input-row">',
'<label>' + this.textDisplay + '</label>', '<label>' + this.textDisplay + '</label>',
@ -169,7 +169,8 @@ define([
me.internalList = new Common.UI.TreeView({ me.internalList = new Common.UI.TreeView({
el: $('#id-dlg-hyperlink-list'), el: $('#id-dlg-hyperlink-list'),
store: new Common.UI.TreeViewStore(), store: new Common.UI.TreeViewStore(),
enableKeyEvents: true enableKeyEvents: true,
tabindex: 1
}); });
me.internalList.on('item:select', _.bind(this.onSelectItem, this)); me.internalList.on('item:select', _.bind(this.onSelectItem, this));
@ -183,6 +184,10 @@ define([
me.internalPanel = $window.find('#id-internal-link'); me.internalPanel = $window.find('#id-internal-link');
}, },
getFocusedComponents: function() {
return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputDisplay, this.inputTip];
},
ShowHideElem: function(value) { ShowHideElem: function(value) {
this.externalPanel.toggleClass('hidden', value !== c_oHyperlinkType.WebLink); this.externalPanel.toggleClass('hidden', value !== c_oHyperlinkType.WebLink);
this.internalPanel.toggleClass('hidden', value !== c_oHyperlinkType.InternalLink); this.internalPanel.toggleClass('hidden', value !== c_oHyperlinkType.InternalLink);
@ -269,8 +274,17 @@ define([
} }
var rec = this.internalList.getSelectedRec(); var rec = this.internalList.getSelectedRec();
this.btnOk.setDisabled(!rec || rec.get('level')==0 && rec.get('index')>0); this.btnOk.setDisabled(!rec || rec.get('level')==0 && rec.get('index')>0);
} else var me = this;
_.delay(function(){
me.inputDisplay.focus();
},50);
} else {
this.btnOk.setDisabled($.trim(this.inputUrl.getValue())==''); this.btnOk.setDisabled($.trim(this.inputUrl.getValue())=='');
var me = this;
_.delay(function(){
me.inputUrl.focus();
},50);
}
}, },
onLinkTypeClick: function(type, btn, event) { onLinkTypeClick: function(type, btn, event) {
@ -296,11 +310,6 @@ define([
show: function() { show: function() {
Common.UI.Window.prototype.show.apply(this, arguments); Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.inputUrl.cmpEl.find('input').focus();
},50);
}, },
setSettings: function (props) { setSettings: function (props) {
@ -414,7 +423,7 @@ define([
if (this.btnExternal.isActive()) {//WebLink if (this.btnExternal.isActive()) {//WebLink
if (this.inputUrl.checkValidate() !== true) { if (this.inputUrl.checkValidate() !== true) {
this.isInputFirstChange = true; this.isInputFirstChange = true;
this.inputUrl.cmpEl.find('input').focus(); this.inputUrl.focus();
return; return;
} }
} else { } else {
@ -423,7 +432,7 @@ define([
return; return;
} }
if (this.inputDisplay.checkValidate() !== true) { if (this.inputDisplay.checkValidate() !== true) {
this.inputDisplay.cmpEl.find('input').focus(); this.inputDisplay.focus();
return; return;
} }
(!this._originalProps.get_Bookmark() && !this._originalProps.get_Value()) && Common.Utils.InternalSettings.set("de-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink (!this._originalProps.get_Bookmark() && !this._originalProps.get_Value()) && Common.Utils.InternalSettings.set("de-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink

View file

@ -351,7 +351,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelativePc data: this._arrHRelativePc,
takeFocusOnClose: true
}); });
this.cmbWidthPc.setDisabled(true); this.cmbWidthPc.setDisabled(true);
this.cmbWidthPc.setValue(this._state.ShapeWidthPcFrom); this.cmbWidthPc.setValue(this._state.ShapeWidthPcFrom);
@ -369,7 +370,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelativePc data: this._arrVRelativePc,
takeFocusOnClose: true
}); });
this.cmbHeightPc.setDisabled(true); this.cmbHeightPc.setDisabled(true);
this.cmbHeightPc.setValue(this._state.ShapeHeightPcFrom); this.cmbHeightPc.setValue(this._state.ShapeHeightPcFrom);
@ -622,7 +624,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHAlign data: this._arrHAlign,
takeFocusOnClose: true
}); });
this.cmbHAlign.setValue(this._state.HAlignType); this.cmbHAlign.setValue(this._state.HAlignType);
this.cmbHAlign.on('selected', _.bind(this.onHAlignSelect, this)); this.cmbHAlign.on('selected', _.bind(this.onHAlignSelect, this));
@ -641,7 +644,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelative data: this._arrHRelative,
takeFocusOnClose: true
}); });
this.cmbHRelative.setValue(this._state.HAlignFrom); this.cmbHRelative.setValue(this._state.HAlignFrom);
this.cmbHRelative.on('selected', _.bind(this.onHRelativeSelect, this)); this.cmbHRelative.on('selected', _.bind(this.onHRelativeSelect, this));
@ -651,7 +655,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelative data: this._arrHRelative,
takeFocusOnClose: true
}); });
this.cmbHPosition.setDisabled(true); this.cmbHPosition.setDisabled(true);
this.cmbHPosition.setValue(this._state.HPositionFrom); this.cmbHPosition.setValue(this._state.HPositionFrom);
@ -686,7 +691,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelativePc data: this._arrHRelativePc,
takeFocusOnClose: true
}); });
this.cmbHPositionPc.setDisabled(true); this.cmbHPositionPc.setDisabled(true);
this.cmbHPositionPc.setValue(this._state.HPositionPcFrom); this.cmbHPositionPc.setValue(this._state.HPositionPcFrom);
@ -704,7 +710,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVAlign data: this._arrVAlign,
takeFocusOnClose: true
}); });
this.cmbVAlign.setValue(this._state.VAlignType); this.cmbVAlign.setValue(this._state.VAlignType);
this.cmbVAlign.on('selected', _.bind(this.onVAlignSelect, this)); this.cmbVAlign.on('selected', _.bind(this.onVAlignSelect, this));
@ -723,7 +730,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelative data: this._arrVRelative,
takeFocusOnClose: true
}); });
this.cmbVRelative.setValue(this._state.VAlignFrom); this.cmbVRelative.setValue(this._state.VAlignFrom);
this.cmbVRelative.on('selected', _.bind(this.onVRelativeSelect, this)); this.cmbVRelative.on('selected', _.bind(this.onVRelativeSelect, this));
@ -733,7 +741,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelative data: this._arrVRelative,
takeFocusOnClose: true
}); });
this.cmbVPosition.setDisabled(true); this.cmbVPosition.setDisabled(true);
this.cmbVPosition.setValue(this._state.VPositionFrom); this.cmbVPosition.setValue(this._state.VPositionFrom);
@ -768,7 +777,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelativePc data: this._arrVRelativePc,
takeFocusOnClose: true
}); });
this.cmbVPositionPc.setDisabled(true); this.cmbVPositionPc.setDisabled(true);
this.cmbVPositionPc.setValue(this._state.VPositionPcFrom); this.cmbVPositionPc.setValue(this._state.VPositionPcFrom);
@ -936,7 +946,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrCapType data: this._arrCapType,
takeFocusOnClose: true
}); });
this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat); this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat);
this.cmbCapType.on('selected', _.bind(function(combo, record){ this.cmbCapType.on('selected', _.bind(function(combo, record){
@ -958,7 +969,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrJoinType data: this._arrJoinType,
takeFocusOnClose: true
}); });
this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round); this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round);
this.cmbJoinType.on('selected', _.bind(function(combo, record){ this.cmbJoinType.on('selected', _.bind(function(combo, record){
@ -1132,6 +1144,59 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.spnWidth, this.spnHeight, // 0 tab
this.spnShapeWidth , this.spnShapeWidthPc, this.cmbWidthPc, this.spnShapeHeight, this.spnShapeHeightPc, this.cmbHeightPc, // 1 tab
this.spnAngle, // 2 tab
this.spnTop, this.spnLeft, this.spnBottom, this.spnRight, // 3 tab
this.cmbHAlign , this.cmbHRelative, this.spnX, this.cmbHPosition, this.spnXPc, this.cmbHPositionPc,
this.cmbVAlign , this.cmbVRelative, this.spnY, this.cmbVPosition, this.spnYPc, this.cmbVPositionPc, // 4 tab
this.cmbCapType, this.cmbJoinType, // 5 tab
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight, // 6 tab
this.inputAltTitle, this.textareaAltDescription // 7 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.spnShapeWidth.focus();
break;
case 2:
me.spnAngle.focus();
break;
case 3:
me.spnTop.focus();
break;
case 4:
if (!me.cmbHAlign.isDisabled())
me.cmbHAlign.focus();
else if (!me.spnX.isDisabled())
me.spnX.focus();
else
me.spnXPc.focus();
break;
case 5:
me.cmbCapType.focus();
break;
case 6:
me.spnMarginTop.focus();
break;
case 7:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
@ -1714,6 +1779,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
} }
if (newValue) { if (newValue) {
this.cmbHAlign.setDisabled(false); this.cmbHAlign.setDisabled(false);
this.cmbHAlign.focus();
this.cmbHRelative.setDisabled(false); this.cmbHRelative.setDisabled(false);
this.spnX.setDisabled(true); this.spnX.setDisabled(true);
this.cmbHPosition.setDisabled(true); this.cmbHPosition.setDisabled(true);
@ -1738,6 +1804,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbHAlign.setDisabled(true); this.cmbHAlign.setDisabled(true);
this.cmbHRelative.setDisabled(true); this.cmbHRelative.setDisabled(true);
this.spnX.setDisabled(false); this.spnX.setDisabled(false);
this.spnX.focus();
this.cmbHPosition.setDisabled(false); this.cmbHPosition.setDisabled(false);
this.spnXPc.setDisabled(true); this.spnXPc.setDisabled(true);
this.cmbHPositionPc.setDisabled(true); this.cmbHPositionPc.setDisabled(true);
@ -1762,6 +1829,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnX.setDisabled(true); this.spnX.setDisabled(true);
this.cmbHPosition.setDisabled(true); this.cmbHPosition.setDisabled(true);
this.spnXPc.setDisabled(false); this.spnXPc.setDisabled(false);
this.spnXPc.focus();
this.cmbHPositionPc.setDisabled(false); this.cmbHPositionPc.setDisabled(false);
} }
}, },
@ -1780,6 +1848,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
} }
if (newValue) { if (newValue) {
this.cmbVAlign.setDisabled(false); this.cmbVAlign.setDisabled(false);
this.cmbVAlign.focus();
this.cmbVRelative.setDisabled(false); this.cmbVRelative.setDisabled(false);
this.spnY.setDisabled(true); this.spnY.setDisabled(true);
this.cmbVPosition.setDisabled(true); this.cmbVPosition.setDisabled(true);
@ -1806,6 +1875,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbVAlign.setDisabled(true); this.cmbVAlign.setDisabled(true);
this.cmbVRelative.setDisabled(true); this.cmbVRelative.setDisabled(true);
this.spnY.setDisabled(false); this.spnY.setDisabled(false);
this.spnY.focus();
this.cmbVPosition.setDisabled(false); this.cmbVPosition.setDisabled(false);
this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscRelativeFromV.Line || this._state.VPositionFrom==Asc.c_oAscRelativeFromV.Paragraph, true); this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscRelativeFromV.Line || this._state.VPositionFrom==Asc.c_oAscRelativeFromV.Paragraph, true);
this.chMove.setDisabled(false); this.chMove.setDisabled(false);
@ -1834,6 +1904,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.chMove.setValue(false, true); this.chMove.setValue(false, true);
this.chMove.setDisabled(true); this.chMove.setDisabled(true);
this.spnYPc.setDisabled(false); this.spnYPc.setDisabled(false);
this.spnYPc.focus();
this.cmbVPositionPc.setDisabled(false); this.cmbVPositionPc.setDisabled(false);
} }
}, },
@ -1850,6 +1921,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbWidthPc.setDisabled(true); this.cmbWidthPc.setDisabled(true);
this.spnShapeWidthPc.setDisabled(true); this.spnShapeWidthPc.setDisabled(true);
this.spnShapeWidth.setDisabled(false); this.spnShapeWidth.setDisabled(false);
this.spnShapeWidth.focus();
} }
}, },
@ -1867,6 +1939,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.chRatio.setDisabled(true); this.chRatio.setDisabled(true);
this.cmbWidthPc.setDisabled(false); this.cmbWidthPc.setDisabled(false);
this.spnShapeWidthPc.setDisabled(false); this.spnShapeWidthPc.setDisabled(false);
this.spnShapeWidthPc.focus();
this.spnShapeWidth.setDisabled(true); this.spnShapeWidth.setDisabled(true);
} }
}, },
@ -1883,6 +1956,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbHeightPc.setDisabled(true); this.cmbHeightPc.setDisabled(true);
this.spnShapeHeightPc.setDisabled(true); this.spnShapeHeightPc.setDisabled(true);
this.spnShapeHeight.setDisabled(false); this.spnShapeHeight.setDisabled(false);
this.spnShapeHeight.focus();
} }
}, },
@ -1900,6 +1974,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.chRatio.setDisabled(true); this.chRatio.setDisabled(true);
this.cmbHeightPc.setDisabled(false); this.cmbHeightPc.setDisabled(false);
this.spnShapeHeightPc.setDisabled(false); this.spnShapeHeightPc.setDisabled(false);
this.spnShapeHeightPc.focus();
this.spnShapeHeight.setDisabled(true); this.spnShapeHeight.setDisabled(true);
} }
}, },

View file

@ -207,6 +207,7 @@ define([
editable : false, editable : false,
template : _.template(template.join('')), template : _.template(template.join('')),
itemsTemplate: _.template(itemsTemplate.join('')), itemsTemplate: _.template(itemsTemplate.join('')),
takeFocusOnClose: true,
data : [ data : [
{ displayValue: this.txtNone, value: Asc.c_oAscNumberingFormat.None }, { displayValue: this.txtNone, value: Asc.c_oAscNumberingFormat.None },
{ displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal }, { displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal },
@ -276,7 +277,8 @@ define([
{ value: AscCommon.align_Left, displayValue: this.textLeft }, { value: AscCommon.align_Left, displayValue: this.textLeft },
{ value: AscCommon.align_Center, displayValue: this.textCenter }, { value: AscCommon.align_Center, displayValue: this.textCenter },
{ value: AscCommon.align_Right, displayValue: this.textRight } { value: AscCommon.align_Right, displayValue: this.textRight }
] ],
takeFocusOnClose: true
}); });
this.cmbAlign.on('selected', _.bind(function (combo, record) { this.cmbAlign.on('selected', _.bind(function (combo, record) {
if (this._changedProps) if (this._changedProps)
@ -310,7 +312,8 @@ define([
{ value: 48, displayValue: "48" }, { value: 48, displayValue: "48" },
{ value: 72, displayValue: "72" }, { value: 72, displayValue: "72" },
{ value: 96, displayValue: "96" } { value: 96, displayValue: "96" }
] ],
takeFocusOnClose: true
}); });
this.cmbSize.on('selected', _.bind(function (combo, record) { this.cmbSize.on('selected', _.bind(function (combo, record) {
if (this._changedProps) { if (this._changedProps) {
@ -328,6 +331,7 @@ define([
this.levelsList = new Common.UI.ListView({ this.levelsList = new Common.UI.ListView({
el: $('#levels-list', this.$window), el: $('#levels-list', this.$window),
store: new Common.UI.DataViewStore(levels), store: new Common.UI.DataViewStore(levels),
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;line-height: 15px;"><%= (value+1) %></div>') itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;overflow: hidden; text-overflow: ellipsis;line-height: 15px;"><%= (value+1) %></div>')
}); });
this.levelsList.on('item:select', _.bind(this.onSelectLevel, this)); this.levelsList.on('item:select', _.bind(this.onSelectLevel, this));
@ -335,6 +339,14 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.cmbFormat, this.cmbAlign, this.cmbSize, {cmp: this.levelsList, selector: '.listview'}];
},
getDefaultFocusableComponent: function () {
return this.type > 0 ? this.cmbFormat : this.cmbAlign;
},
afterRender: function() { afterRender: function() {
this.updateThemeColors(); this.updateThemeColors();
this._setDefaults(this.props); this._setDefaults(this.props);

View file

@ -70,7 +70,8 @@ define([
store: this.storeNavigation, store: this.storeNavigation,
enableKeyEvents: false, enableKeyEvents: false,
emptyText: this.txtEmpty, emptyText: this.txtEmpty,
emptyItemText: this.txtEmptyItem emptyItemText: this.txtEmptyItem,
style: 'border: none;'
}); });
this.viewNavigationList.cmpEl.off('click'); this.viewNavigationList.cmpEl.off('click');
this.navigationMenu = new Common.UI.Menu({ this.navigationMenu = new Common.UI.Menu({

View file

@ -159,6 +159,9 @@ define([
this.radioFootnote.on('change', function(field, newValue, eOpts) { this.radioFootnote.on('change', function(field, newValue, eOpts) {
if (newValue) { if (newValue) {
me.changeNoteType(false); me.changeNoteType(false);
setTimeout(function(){
me.cmbFootnote.focus();
}, 1);
} }
}); });
@ -170,6 +173,9 @@ define([
this.radioEndnote.on('change', function(field, newValue, eOpts) { this.radioEndnote.on('change', function(field, newValue, eOpts) {
if (newValue) { if (newValue) {
me.changeNoteType(true); me.changeNoteType(true);
setTimeout(function(){
me.cmbEndnote.focus();
}, 1);
} }
}); });
@ -178,6 +184,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 150px;', menuStyle: 'min-width: 150px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom }, { displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom },
{ displayValue: this.textTextBottom, value: Asc.c_oAscFootnotePos.BeneathText } { displayValue: this.textTextBottom, value: Asc.c_oAscFootnotePos.BeneathText }
@ -190,6 +197,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 150px;', menuStyle: 'min-width: 150px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: this.textSectEnd, value: Asc.c_oAscFootnotePos.SectEnd }, { displayValue: this.textSectEnd, value: Asc.c_oAscFootnotePos.SectEnd },
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom } { displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom }
@ -202,6 +210,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 150px;', menuStyle: 'min-width: 150px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 }, { displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal, maskExp: /[0-9]/, defValue: 1 },
{ displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' }, { displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter, maskExp: /[a-z]/, defValue: 'a' },
@ -235,6 +244,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 150px;', menuStyle: 'min-width: 150px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: this._arrNumbering data: this._arrNumbering
}); });
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous); this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous);
@ -257,6 +267,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 150px;', menuStyle: 'min-width: 150px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ displayValue: this.textDocument, value: 1 }, { displayValue: this.textDocument, value: 1 },
{ displayValue: this.textSection, value: 0 } { displayValue: this.textSection, value: 0 }
@ -271,12 +282,16 @@ define([
this.afterRender(); this.afterRender();
}, },
afterRender: function() { getFocusedComponents: function() {
this._setDefaults(this.props); return [this.cmbFootnote, this.cmbEndnote, this.cmbFormat, this.spnStart, this.cmbNumbering, this.txtCustom, this.cmbApply];
}, },
show: function() { getDefaultFocusableComponent: function () {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); return this.cmbFormat;
},
afterRender: function() {
this._setDefaults(this.props);
}, },
_setDefaults: function (props) { _setDefaults: function (props) {

View file

@ -213,6 +213,7 @@ define([
menuStyle : 'min-width: 86px;', menuStyle : 'min-width: 86px;',
style : 'width: 86px;', style : 'width: 86px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 0, displayValue: this.textLeft }, { value: 0, displayValue: this.textLeft },
@ -232,6 +233,7 @@ define([
menuStyle : 'min-width: 180px;', menuStyle : 'min-width: 180px;',
style : 'width: 180px;', style : 'width: 180px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 0, displayValue: this.textPortrait }, { value: 0, displayValue: this.textPortrait },
@ -275,6 +277,7 @@ define([
menuStyle : 'min-width: 180px;', menuStyle : 'min-width: 180px;',
style : 'width: 180px;', style : 'width: 180px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 0, displayValue: this.textNormal }, { value: 0, displayValue: this.textNormal },
@ -305,6 +308,14 @@ define([
this.updateMetricUnit(); this.updateMetricUnit();
}, },
getFocusedComponents: function() {
return [this.spnTop, this.spnBottom, this.spnLeft, this.spnRight, this.spnGutter, this.cmbGutterPosition, this.cmbOrientation, this.cmbMultiplePages];
},
getDefaultFocusableComponent: function () {
return this.spnTop;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) { if (this.options.handler) {
if (state == 'ok') { if (state == 'ok') {

View file

@ -129,6 +129,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 183px;max-height: 208px;', menuStyle: 'min-width: 183px;max-height: 208px;',
editable: false, editable: false,
takeFocusOnClose: true,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data: [ data: [
{ value: 0, displayValue: 'US Letter', size: [215.9, 279.4]}, { value: 0, displayValue: 'US Letter', size: [215.9, 279.4]},
@ -168,6 +169,14 @@ define([
this.updateMetricUnit(); this.updateMetricUnit();
}, },
getFocusedComponents: function() {
return [this.cmbPreset, this.spnWidth, this.spnHeight];
},
getDefaultFocusableComponent: function () {
return this.cmbPreset;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, this, state); this.options.handler.call(this, this, state);

View file

@ -237,7 +237,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
editable: false, editable: false,
data: this._arrLineRule, data: this._arrLineRule,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbLineRule.setValue(this.CurLineRuleIdx); this.cmbLineRule.setValue(this.CurLineRuleIdx);
this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
@ -265,7 +266,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
editable: false, editable: false,
data: this._arrSpecial, data: this._arrSpecial,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbSpecial.setValue(''); this.cmbSpecial.setValue('');
this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this)); this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this));
@ -289,7 +291,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
editable: false, editable: false,
data: this._arrTextAlignment, data: this._arrTextAlignment,
style: 'width: 173px;', style: 'width: 173px;',
menuStyle : 'min-width: 173px;' menuStyle : 'min-width: 173px;',
takeFocusOnClose: true
}); });
this.cmbTextAlignment.setValue(''); this.cmbTextAlignment.setValue('');
@ -299,7 +302,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
editable: false, editable: false,
data: this._arrOutlinelevel, data: this._arrOutlinelevel,
style: 'width: 174px;', style: 'width: 174px;',
menuStyle : 'min-width: 174px;' menuStyle : 'min-width: 174px;',
takeFocusOnClose: true
}); });
this.cmbOutlinelevel.setValue(-1); this.cmbOutlinelevel.setValue(-1);
this.cmbOutlinelevel.on('selected', _.bind(this.onOutlinelevelSelect, this)); this.cmbOutlinelevel.on('selected', _.bind(this.onOutlinelevelSelect, this));
@ -538,7 +542,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
'<div style="width:121px;display: inline-block;"><%= displayTabAlign %></div>', '<div style="width:121px;display: inline-block;"><%= displayTabAlign %></div>',
'<div style="width:96px;display: inline-block;"><%= displayTabLeader %></div>', '<div style="width:96px;display: inline-block;"><%= displayTabLeader %></div>',
'</div>' '</div>'
].join('')) ].join('')),
tabindex: 1
}); });
this.tabList.store.comparator = function(rec) { this.tabList.store.comparator = function(rec) {
return rec.get("tabPos"); return rec.get("tabPos");
@ -559,7 +564,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
menuStyle : 'min-width: 108px;', menuStyle : 'min-width: 108px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : this._arrTabAlign data : this._arrTabAlign,
takeFocusOnClose: true
}); });
this.cmbAlign.setValue(Asc.c_oAscTabType.Left); this.cmbAlign.setValue(Asc.c_oAscTabType.Left);
@ -569,7 +575,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
menuStyle : 'min-width: 108px;', menuStyle : 'min-width: 108px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : this._arrTabLeader data : this._arrTabLeader,
takeFocusOnClose: true
}); });
this.cmbLeader.setValue(Asc.c_oAscTabLeader.None); this.cmbLeader.setValue(Asc.c_oAscTabLeader.None);
@ -666,6 +673,38 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.cmbTextAlignment, this.cmbOutlinelevel, this.numIndentsLeft, this.numIndentsRight, this.cmbSpecial, this.numSpecialBy,
this.numSpacingBefore, this.numSpacingAfter, this.cmbLineRule, this.numLineHeight, // 0 tab
this.numSpacing, this.numPosition, // 3 tab
this.numDefaultTab, this.numTab, this.cmbAlign, this.cmbLeader, {cmp: this.tabList, selector: '.listview'}, // 4 tab
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight // 5 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
switch (index) {
case 0:
me.cmbTextAlignment.focus();
break;
case 3:
me.numSpacing.focus();
break;
case 4:
me.numDefaultTab.focus();
break;
case 5:
me.spnMarginTop.focus();
break;
}
}, 10);
},
getSettings: function() { getSettings: function() {
if ( this.ChangedBorders === null ) { if ( this.ChangedBorders === null ) {
this._changedProps.put_Borders(this.Borders); this._changedProps.put_Borders(this.Borders);

View file

@ -103,6 +103,7 @@ define([
style : 'width: 100%;', style : 'width: 100%;',
menuStyle : 'width: 100%; max-height: 210px;', menuStyle : 'width: 100%; max-height: 210px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : this.options.formats, data : this.options.formats,
disabled : (this.options.formats.length==0) disabled : (this.options.formats.length==0)
@ -110,13 +111,12 @@ define([
this.cmbNextStyle.setValue(-1); this.cmbNextStyle.setValue(-1);
}, },
show: function() { getFocusedComponents: function() {
Common.UI.Window.prototype.show.apply(this, arguments); return [this.inputTitle, this.cmbNextStyle];
},
var me = this; getDefaultFocusableComponent: function () {
_.delay(function(){ return this.inputTitle;
me.inputTitle.cmpEl.find('input').focus();
},500);
}, },
getTitle: function () { getTitle: function () {
@ -143,7 +143,7 @@ define([
if (state == 'ok') { if (state == 'ok') {
var checkurl = this.inputTitle.checkValidate(); var checkurl = this.inputTitle.checkValidate();
if (checkurl !== true) { if (checkurl !== true) {
this.inputTitle.cmpEl.find('input').focus(); this.inputTitle.focus();
return; return;
} }
} }

View file

@ -96,7 +96,8 @@ define([
this.cmbFormat = new Common.UI.ComboBox({ this.cmbFormat = new Common.UI.ComboBox({
el : $('#id-dlg-formula-format'), el : $('#id-dlg-formula-format'),
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 100%; max-height: 200px;' menuStyle : 'min-width: 100%; max-height: 200px;',
takeFocusOnClose: true
}); });
this.cmbFunction = new Common.UI.ComboBox({ this.cmbFunction = new Common.UI.ComboBox({
@ -104,6 +105,7 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 100%; max-height: 150px;', menuStyle : 'min-width: 100%; max-height: 150px;',
editable : false, editable : false,
takeFocusOnClose: true,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data: [ data: [
{displayValue: 'ABS', value: 1}, {displayValue: 'ABS', value: 1},
@ -141,7 +143,8 @@ define([
el : $('#id-dlg-formula-bookmark'), el : $('#id-dlg-formula-bookmark'),
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 100%; max-height: 150px;', menuStyle : 'min-width: 100%; max-height: 150px;',
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbBookmark.on('selected', _.bind(function(combo, record) { this.cmbBookmark.on('selected', _.bind(function(combo, record) {
combo.setValue(this.textBookmark); combo.setValue(this.textBookmark);
@ -162,17 +165,16 @@ define([
this.afterRender(); this.afterRender();
}, },
onSelectItem: function(picker, item, record, e){ getFocusedComponents: function() {
this.btnOk.setDisabled(record.get('level')==0 && record.get('index')>0); return [this.inputFormula, this.cmbFormat, this.cmbFunction, this.cmbBookmark];
}, },
show: function() { getDefaultFocusableComponent: function () {
Common.UI.Window.prototype.show.apply(this, arguments); return this.inputFormula;
},
var me = this; onSelectItem: function(picker, item, record, e){
_.delay(function(){ this.btnOk.setDisabled(record.get('level')==0 && record.get('index')>0);
me.inputFormula.cmpEl.find('input').focus();
},500);
}, },
afterRender: function() { afterRender: function() {

View file

@ -182,7 +182,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
data : [ data : [
{ value: 0, displayValue: (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : this.txtCm) }, { value: 0, displayValue: (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : this.txtCm) },
{ value: 1, displayValue: this.txtPercent } { value: 1, displayValue: this.txtPercent }
] ],
takeFocusOnClose: true
}); });
this.cmbUnit.on('selected', _.bind(function(combo, record) { this.cmbUnit.on('selected', _.bind(function(combo, record) {
if (this._changedProps) { if (this._changedProps) {
@ -475,7 +476,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
data : [ data : [
{ value: 0, displayValue: (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : this.txtCm) }, { value: 0, displayValue: (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : this.txtCm) },
{ value: 1, displayValue: this.txtPercent } { value: 1, displayValue: this.txtPercent }
] ],
takeFocusOnClose: true
}); });
this.cmbPrefWidthUnit.on('selected', _.bind(function(combo, record) { this.cmbPrefWidthUnit.on('selected', _.bind(function(combo, record) {
if (this._changedProps) { if (this._changedProps) {
@ -736,7 +738,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHAlign data: this._arrHAlign,
takeFocusOnClose: true
}); });
this.cmbHAlign.setValue(this._state.HAlignType); this.cmbHAlign.setValue(this._state.HAlignType);
this.cmbHAlign.on('selected', _.bind(this.onHAlignSelect, this)); this.cmbHAlign.on('selected', _.bind(this.onHAlignSelect, this));
@ -752,7 +755,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelative data: this._arrHRelative,
takeFocusOnClose: true
}); });
this.cmbHRelative.setValue(this._state.HAlignFrom); this.cmbHRelative.setValue(this._state.HAlignFrom);
this.cmbHRelative.on('selected', _.bind(this.onHRelativeSelect, this)); this.cmbHRelative.on('selected', _.bind(this.onHRelativeSelect, this));
@ -762,7 +766,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrHRelative data: this._arrHRelative,
takeFocusOnClose: true
}); });
this.cmbHPosition.setDisabled(true); this.cmbHPosition.setDisabled(true);
this.cmbHPosition.setValue(this._state.HPositionFrom); this.cmbHPosition.setValue(this._state.HPositionFrom);
@ -780,7 +785,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVAlign data: this._arrVAlign,
takeFocusOnClose: true
}); });
this.cmbVAlign.setValue(this._state.VAlignType); this.cmbVAlign.setValue(this._state.VAlignType);
this.cmbVAlign.on('selected', _.bind(this.onVAlignSelect, this)); this.cmbVAlign.on('selected', _.bind(this.onVAlignSelect, this));
@ -796,7 +802,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelative data: this._arrVRelative,
takeFocusOnClose: true
}); });
this.cmbVRelative.setValue(this._state.VAlignFrom); this.cmbVRelative.setValue(this._state.VAlignFrom);
this.cmbVRelative.on('selected', _.bind(this.onVRelativeSelect, this)); this.cmbVRelative.on('selected', _.bind(this.onVRelativeSelect, this));
@ -806,7 +813,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 115px;', menuStyle: 'min-width: 115px;',
editable: false, editable: false,
data: this._arrVRelative data: this._arrVRelative,
takeFocusOnClose: true
}); });
this.cmbVPosition.setDisabled(true); this.cmbVPosition.setDisabled(true);
this.cmbVPosition.setValue(this._state.VPositionFrom); this.cmbVPosition.setValue(this._state.VPositionFrom);
@ -995,10 +1003,58 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.CellBackContainer = $('#tableadv-panel-cell-back'); this.CellBackContainer = $('#tableadv-panel-cell-back');
this.TableBackContainer = $('#tableadv-panel-table-back'); this.TableBackContainer = $('#tableadv-panel-table-back');
this.btnsCategory[1].on('click', _.bind(this.onCellCategoryClick, this));
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.nfWidth, this.cmbUnit, this.spnTableMarginTop, this.spnTableMarginLeft, this.spnTableMarginBottom, this.spnTableMarginRight, this.nfSpacing, // 0 tab
this.nfPrefWidth, this.cmbPrefWidthUnit, this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight, // 1 tab
this.cmbHAlign , this.cmbHRelative, this.spnX, this.cmbHPosition,
this.cmbVAlign , this.cmbVRelative, this.spnY, this.cmbVPosition, // 3 tab
this.spnIndentLeft, this.spnDistanceTop, this.spnDistanceLeft, this.spnDistanceBottom, this.spnDistanceRight, // 4 tab
this.inputAltTitle, this.textareaAltDescription // 5 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
switch (index) {
case 0:
if (!me.nfWidth.isDisabled())
me.nfWidth.focus();
else
me.spnTableMarginTop.focus();
break;
case 1:
me.onCellCategoryClick(btn);
if (!me.nfPrefWidth.isDisabled())
me.nfPrefWidth.focus();
else if (!me.spnMarginTop.isDisabled())
me.spnMarginTop.focus();
break;
case 3:
if (!me.cmbHAlign.isDisabled())
me.cmbHAlign.focus();
else
me.spnX.focus();
break;
case 4:
if (me.spnIndentLeft.isVisible())
me.spnIndentLeft.focus();
else
me.spnDistanceTop.focus();
break;
case 5:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this.updateThemeColors(); this.updateThemeColors();
@ -1438,6 +1494,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.spnIndentLeft.setDisabled(!this.btnAlignLeft.pressed); this.spnIndentLeft.setDisabled(!this.btnAlignLeft.pressed);
this._changedProps.put_TableIndent(Common.Utils.Metric.fnRecalcToMM(this.spnIndentLeft.getNumberValue())); this._changedProps.put_TableIndent(Common.Utils.Metric.fnRecalcToMM(this.spnIndentLeft.getNumberValue()));
} }
!this.spnIndentLeft.isDisabled() && this.spnIndentLeft.focus();
}, },
onBtnFlowWrapClick: function(btn, e) { onBtnFlowWrapClick: function(btn, e) {
@ -1467,6 +1524,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.radioHPosition.setValue(true); this.radioHPosition.setValue(true);
} }
} }
this.spnDistanceTop.focus();
}, },
onHAlignSelect: function(combo, record){ onHAlignSelect: function(combo, record){
@ -1566,6 +1624,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
} }
if (newValue) { if (newValue) {
this.cmbHAlign.setDisabled(false); this.cmbHAlign.setDisabled(false);
this.cmbHAlign.focus();
this.cmbHRelative.setDisabled(false); this.cmbHRelative.setDisabled(false);
this.spnX.setDisabled(true); this.spnX.setDisabled(true);
this.cmbHPosition.setDisabled(true); this.cmbHPosition.setDisabled(true);
@ -1593,6 +1652,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.cmbHAlign.setDisabled(true); this.cmbHAlign.setDisabled(true);
this.cmbHRelative.setDisabled(true); this.cmbHRelative.setDisabled(true);
this.spnX.setDisabled(false); this.spnX.setDisabled(false);
this.spnX.focus();
this.cmbHPosition.setDisabled(false); this.cmbHPosition.setDisabled(false);
this._state.alignChanged = false; this._state.alignChanged = false;
} }
@ -1612,6 +1672,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
} }
if (newValue) { if (newValue) {
this.cmbVAlign.setDisabled(false); this.cmbVAlign.setDisabled(false);
this.cmbVAlign.focus();
this.cmbVRelative.setDisabled(false); this.cmbVRelative.setDisabled(false);
this.spnY.setDisabled(true); this.spnY.setDisabled(true);
this.cmbVPosition.setDisabled(true); this.cmbVPosition.setDisabled(true);
@ -1638,6 +1699,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.cmbVAlign.setDisabled(true); this.cmbVAlign.setDisabled(true);
this.cmbVRelative.setDisabled(true); this.cmbVRelative.setDisabled(true);
this.spnY.setDisabled(false); this.spnY.setDisabled(false);
this.spnY.focus();
this.cmbVPosition.setDisabled(false); this.cmbVPosition.setDisabled(false);
this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscVAnchor.Text, true); this.chMove.setValue(this._state.VPositionFrom==Asc.c_oAscVAnchor.Text, true);
} }

View file

@ -148,6 +148,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
// disable text // disable text
this.props.put_Type(Asc.c_oAscWatermarkType.Image); this.props.put_Type(Asc.c_oAscWatermarkType.Image);
this.disableControls(Asc.c_oAscWatermarkType.Image); this.disableControls(Asc.c_oAscWatermarkType.Image);
this.focusControls();
} }
}, this)); }, this));
@ -162,6 +163,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
// disable image // disable image
this.props.put_Type(Asc.c_oAscWatermarkType.Text); this.props.put_Type(Asc.c_oAscWatermarkType.Text);
this.disableControls(Asc.c_oAscWatermarkType.Text); this.disableControls(Asc.c_oAscWatermarkType.Text);
this.focusControls();
} }
}, this)); }, this));
@ -198,7 +200,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
el : $('#watermark-combo-scale'), el : $('#watermark-combo-scale'),
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 142px;', menuStyle : 'min-width: 142px;',
data : this._arrScale data : this._arrScale,
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
}, this)); }, this));
this.cmbScale.setValue(this._arrScale[0].value); this.cmbScale.setValue(this._arrScale[0].value);
@ -211,7 +214,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
editable : false, editable : false,
menuStyle : 'min-width: 100%;max-height: 210px;', menuStyle : 'min-width: 100%;max-height: 210px;',
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data : [] data : [],
takeFocusOnClose: true
}).on('selected', _.bind(this.onSelectLang, this)); }).on('selected', _.bind(this.onSelectLang, this));
this.cmbLang.setValue(Common.util.LanguageInfo.getLocalLanguageName(9)[1]);//en this.cmbLang.setValue(Common.util.LanguageInfo.getLocalLanguageName(9)[1]);//en
this.textControls.push(this.cmbLang); this.textControls.push(this.cmbLang);
@ -222,7 +226,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
menuStyle : 'min-width: 100%;max-height: 210px;', menuStyle : 'min-width: 100%;max-height: 210px;',
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
displayField: 'value', displayField: 'value',
data : [{value: "ASAP"}, {value: "CONFIDENTIAL"}, {value: "COPY"}, {value: "DO NOT COPY"}, {value: "DRAFT"}, {value: "ORIGINAL"}, {value: "PERSONAL"}, {value: "SAMPLE"}, {value: "TOP SECRET"}, {value: "URGENT"} ] data : [{value: "ASAP"}, {value: "CONFIDENTIAL"}, {value: "COPY"}, {value: "DO NOT COPY"}, {value: "DRAFT"}, {value: "ORIGINAL"}, {value: "PERSONAL"}, {value: "SAMPLE"}, {value: "TOP SECRET"}, {value: "URGENT"} ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
}, this)); }, this));
this.cmbText.setValue(this.cmbText.options.data[0].value); this.cmbText.setValue(this.cmbText.options.data[0].value);
@ -236,7 +241,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
menuStyle : 'min-width: 100%;max-height: 270px;', menuStyle : 'min-width: 100%;max-height: 270px;',
store : new Common.Collections.Fonts(), store : new Common.Collections.Fonts(),
recent : 0, recent : 0,
hint : this.tipFontName hint : this.tipFontName,
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
this.fontName = record.name; this.fontName = record.name;
}, this)); }, this));
@ -266,7 +272,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
menuCls : 'scrollable-menu', menuCls : 'scrollable-menu',
menuStyle: 'min-width: 55px;max-height: 270px;', menuStyle: 'min-width: 55px;max-height: 270px;',
hint: this.tipFontSize, hint: this.tipFontSize,
data: data data: data,
takeFocusOnClose: true
}); });
this.cmbFontSize.setValue(-1); this.cmbFontSize.setValue(-1);
this.textControls.push(this.cmbFontSize); this.textControls.push(this.cmbFontSize);
@ -376,6 +383,24 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [ this.cmbLang, this.cmbText, this.cmbFonts, this.cmbFontSize, this.cmbScale ];
},
getDefaultFocusableComponent: function () {
if (!this.cmbLang.isDisabled())
return this.cmbLang;
else if (!this.cmbScale.isDisabled())
return this.cmbScale;
},
focusControls: function() {
var el = this.getDefaultFocusableComponent();
el && setTimeout(function(){
el.focus();
}, 10);
},
onColorSelect: function(picker, color) { onColorSelect: function(picker, color) {
var clr_item = this.btnTextColor.menu.$el.find('#watermark-auto-color > a'); var clr_item = this.btnTextColor.menu.$el.find('#watermark-auto-color > a');
clr_item.hasClass('selected') && clr_item.removeClass('selected'); clr_item.hasClass('selected') && clr_item.removeClass('selected');
@ -432,12 +457,9 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
}); });
}, },
show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
},
loadLanguages: function() { loadLanguages: function() {
var me = this; var me = this,
focus = false;
var callback = function(languages) { var callback = function(languages) {
var data = []; var data = [];
me.languages = languages; me.languages = languages;
@ -455,8 +477,10 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
me.text && me.cmbText.setValue(me.text); me.text && me.cmbText.setValue(me.text);
} else } else
me.cmbLang.setDisabled(true); me.cmbLang.setDisabled(true);
focus && me.focusControls();
}; };
var languages = DE.Views.WatermarkText.get(); var languages = DE.Views.WatermarkText.get();
focus = !languages;
if (languages) if (languages)
callback(languages); callback(languages);
else else

View file

@ -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) { _setDefaults: function(props) {
if (props ){ if (props ){
var value = props.asc_getTitle(); var value = props.asc_getTitle();

View file

@ -102,7 +102,10 @@ define([
menuStyle : 'min-width: 100%; max-height: 185px;', menuStyle : 'min-width: 100%; max-height: 185px;',
cls : 'input-group-nr', cls : 'input-group-nr',
editable : false, editable : false,
data : data takeFocusOnClose: true,
data : data,
search: true,
scrollAlwaysVisible: true
}); });
this.cmbLang.setValue(0x0409); this.cmbLang.setValue(0x0409);
this.cmbLang.on('selected', _.bind(function(combo, record) { this.cmbLang.on('selected', _.bind(function(combo, record) {
@ -120,13 +123,13 @@ define([
this.listFormats = new Common.UI.ListView({ this.listFormats = new Common.UI.ListView({
el: $('#datetime-dlg-format'), el: $('#datetime-dlg-format'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
scrollAlwaysVisible: true scrollAlwaysVisible: true,
tabindex: 1
}); });
this.listFormats.on('item:select', _.bind(this.onSelectFormat, this)); this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this)); this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this));
this.listFormats.on('entervalue', _.bind(this.onPrimary, this)); this.listFormats.on('entervalue', _.bind(this.onPrimary, this));
this.listFormats.$el.find('.listview').focus();
this.btnDefault = new Common.UI.Button({ this.btnDefault = new Common.UI.Button({
el: $('#datetime-dlg-default') el: $('#datetime-dlg-default')
@ -172,6 +175,14 @@ define([
this._setDefaults(); this._setDefaults();
}, },
getFocusedComponents: function() {
return [this.cmbLang, {cmp: this.listFormats, selector: '.listview'}];
},
getDefaultFocusableComponent: function () {
return this.cmbLang;
},
_setDefaults: function () { _setDefaults: function () {
this.props = new AscCommonSlide.CAscDateTime(); this.props = new AscCommonSlide.CAscDateTime();
if (this.lang) { if (this.lang) {

View file

@ -136,7 +136,10 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
menuStyle : 'min-width: 100%; max-height: 185px;', menuStyle : 'min-width: 100%; max-height: 185px;',
cls : 'input-group-nr', cls : 'input-group-nr',
editable : false, editable : false,
data : data data : data,
search: true,
scrollAlwaysVisible: true,
takeFocusOnClose: true
}); });
this.cmbLang.setValue(0x0409); this.cmbLang.setValue(0x0409);
this.cmbLang.on('selected', _.bind(function(combo, record) { this.cmbLang.on('selected', _.bind(function(combo, record) {
@ -149,7 +152,8 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
menuStyle : 'min-width: 100%; max-height: 185px;', menuStyle : 'min-width: 100%; max-height: 185px;',
cls : 'input-group-nr', cls : 'input-group-nr',
editable : false, editable : false,
data : [] data : [],
takeFocusOnClose: true
}); });
this.dateControls.push(this.cmbFormat); this.dateControls.push(this.cmbFormat);
@ -183,6 +187,26 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [ this.cmbFormat, this.cmbLang, this.inputFixed, this.inputFooter ];
},
getDefaultFocusableComponent: function () {
if (!this.cmbFormat.isDisabled())
return this.cmbFormat;
else if (!this.inputFixed.isDisabled())
return this.inputFixed;
else if (!this.inputFooter.isDisabled())
return this.inputFooter;
},
focusControls: function() {
var el = this.getDefaultFocusableComponent();
el && setTimeout(function(){
el.focus();
}, 10);
},
afterRender: function() { afterRender: function() {
var me = this, var me = this,
value = Common.Utils.InternalSettings.get("pe-settings-datetime-default"), value = Common.Utils.InternalSettings.get("pe-settings-datetime-default"),
@ -205,6 +229,7 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
}); });
newValue && this.setDateTimeType(this.radioFixed.getValue() ? 'fixed' : 'update', null, true); newValue && this.setDateTimeType(this.radioFixed.getValue() ? 'fixed' : 'update', null, true);
this.props.put_ShowDateTime(newValue); this.props.put_ShowDateTime(newValue);
this.focusControls();
} else if (type == 'slide') { } else if (type == 'slide') {
this.props.put_ShowSlideNum(newValue); this.props.put_ShowSlideNum(newValue);
} else if (type == 'footer') { } else if (type == 'footer') {
@ -241,10 +266,7 @@ define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
this.cmbLang.setDisabled(type == 'fixed'); this.cmbLang.setDisabled(type == 'fixed');
this.cmbFormat.setDisabled(type == 'fixed'); this.cmbFormat.setDisabled(type == 'fixed');
this.inputFixed.setDisabled(type == 'update'); this.inputFixed.setDisabled(type == 'update');
(type == 'fixed') && setTimeout(function(){ this.focusControls();
me.inputFixed.cmpEl.find('input').focus();
},50);
} }
}, },

View file

@ -84,7 +84,7 @@ define([
'<div class="input-row">', '<div class="input-row">',
'<label>' + this.strLinkTo + '</label>', '<label>' + this.strLinkTo + '</label>',
'</div>', '</div>',
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;border: 1px solid #cfcfcf;"></div>', '<div id="id-dlg-hyperlink-list" style="width:100%; height: 171px;"></div>',
'</div>', '</div>',
'<div class="input-row">', '<div class="input-row">',
'<label>' + this.strDisplay + '</label>', '<label>' + this.strDisplay + '</label>',
@ -171,7 +171,8 @@ define([
me.internalList = new Common.UI.TreeView({ me.internalList = new Common.UI.TreeView({
el: $('#id-dlg-hyperlink-list'), el: $('#id-dlg-hyperlink-list'),
store: new Common.UI.TreeViewStore(), store: new Common.UI.TreeViewStore(),
enableKeyEvents: true enableKeyEvents: true,
tabindex: 1
}); });
me.internalList.on('item:select', _.bind(this.onSelectItem, this)); me.internalList.on('item:select', _.bind(this.onSelectItem, this));
@ -186,6 +187,10 @@ define([
me.internalPanel = $window.find('#id-internal-link'); me.internalPanel = $window.find('#id-internal-link');
}, },
getFocusedComponents: function() {
return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputDisplay, this.inputTip];
},
setSettings: function (props) { setSettings: function (props) {
if (props) { if (props) {
var me = this; var me = this;
@ -205,11 +210,6 @@ define([
this.isTextChanged = false; this.isTextChanged = false;
this.inputTip.setValue(props.get_ToolTip()); this.inputTip.setValue(props.get_ToolTip());
if (type==c_oHyperlinkType.WebLink) {
_.delay(function(){
me.inputUrl.cmpEl.find('input').focus();
},50);
}
me._originalProps = props; me._originalProps = props;
} }
}, },
@ -269,11 +269,11 @@ define([
checkdisp = this.inputDisplay.checkValidate(); checkdisp = this.inputDisplay.checkValidate();
if (checkurl !== true) { if (checkurl !== true) {
this.isInputFirstChange = true; this.isInputFirstChange = true;
this.inputUrl.cmpEl.find('input').focus(); this.inputUrl.focus();
return; return;
} }
if (checkdisp !== true) { if (checkdisp !== true) {
this.inputDisplay.cmpEl.find('input').focus(); this.inputDisplay.focus();
return; return;
} }
!this._originalProps.get_Value() && Common.Utils.InternalSettings.set("pe-settings-link-type", this.btnInternal.isActive()); !this._originalProps.get_Value() && Common.Utils.InternalSettings.set("pe-settings-link-type", this.btnInternal.isActive());
@ -372,8 +372,17 @@ define([
var rec = this.internalList.getSelectedRec(); var rec = this.internalList.getSelectedRec();
rec && this.internalList.scrollToRecord(rec); rec && this.internalList.scrollToRecord(rec);
this.btnOk.setDisabled(!rec || rec.get('index')==4); this.btnOk.setDisabled(!rec || rec.get('index')==4);
} else var me = this;
_.delay(function(){
me.inputDisplay.focus();
},50);
} else {
this.btnOk.setDisabled($.trim(this.inputUrl.getValue())==''); this.btnOk.setDisabled($.trim(this.inputUrl.getValue())=='');
var me = this;
_.delay(function(){
me.inputUrl.focus();
},50);
}
}, },
onLinkTypeClick: function(type, btn, event) { onLinkTypeClick: function(type, btn, event) {

View file

@ -220,6 +220,33 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
this.afterRender(); 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() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);

View file

@ -127,7 +127,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
editable: false, editable: false,
data: this._arrTextAlignment, data: this._arrTextAlignment,
style: 'width: 173px;', style: 'width: 173px;',
menuStyle : 'min-width: 173px;' menuStyle : 'min-width: 173px;',
takeFocusOnClose: true
}); });
this.cmbTextAlignment.setValue(''); this.cmbTextAlignment.setValue('');
@ -176,7 +177,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
editable: false, editable: false,
data: this._arrSpecial, data: this._arrSpecial,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbSpecial.setValue(''); this.cmbSpecial.setValue('');
this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this)); this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this));
@ -240,7 +242,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
editable: false, editable: false,
data: this._arrLineRule, data: this._arrLineRule,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbLineRule.setValue(this.CurLineRuleIdx); this.cmbLineRule.setValue(this.CurLineRuleIdx);
this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
@ -355,7 +358,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
'<div style="width: 117px;display: inline-block;"><%= value %></div>', '<div style="width: 117px;display: inline-block;"><%= value %></div>',
'<div style="display: inline-block;"><%= displayTabAlign %></div>', '<div style="display: inline-block;"><%= displayTabAlign %></div>',
'</div>' '</div>'
].join('')) ].join('')),
tabindex: 1
}); });
this.tabList.store.comparator = function(rec) { this.tabList.store.comparator = function(rec) {
return rec.get("tabPos"); return rec.get("tabPos");
@ -376,7 +380,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
menuStyle : 'min-width: 108px;', menuStyle : 'min-width: 108px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : this._arrTabAlign data : this._arrTabAlign,
takeFocusOnClose: true
}); });
this.cmbAlign.setValue(Asc.c_oAscTabType.Left); this.cmbAlign.setValue(Asc.c_oAscTabType.Left);
@ -398,6 +403,34 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.cmbTextAlignment, this.numIndentsLeft, this.numIndentsRight, this.cmbSpecial, this.numSpecialBy,
this.numSpacingBefore, this.numSpacingAfter, this.cmbLineRule, this.numLineHeight, // 0 tab
this.numSpacing, // 1 tab
this.numDefaultTab, this.numTab, this.cmbAlign, {cmp: this.tabList, selector: '.listview'} // 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.cmbTextAlignment.focus();
break;
case 1:
me.numSpacing.focus();
break;
case 2:
me.numDefaultTab.focus();
break;
}
}, 10);
},
getSettings: function() { getSettings: function() {
if ( this._tabListChanged ) { if ( this._tabListChanged ) {
if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined) if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined)

View file

@ -289,7 +289,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrCapType data: this._arrCapType,
takeFocusOnClose: true
}); });
this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat); this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat);
this.cmbCapType.on('selected', _.bind(function(combo, record){ this.cmbCapType.on('selected', _.bind(function(combo, record){
@ -311,7 +312,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrJoinType data: this._arrJoinType,
takeFocusOnClose: true
}); });
this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round); this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round);
this.cmbJoinType.on('selected', _.bind(function(combo, record){ this.cmbJoinType.on('selected', _.bind(function(combo, record){
@ -517,6 +519,45 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.spnWidth, this.spnHeight, // 0 tab
this.spnAngle, // 1 tab
this.cmbCapType, this.cmbJoinType, // 2 tab
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight, // 3 tab
this.spnColumns, this.spnSpacing, // 4 tab
this.inputAltTitle, this.textareaAltDescription // 5 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.cmbCapType.focus();
break;
case 3:
me.spnMarginTop.focus();
break;
case 4:
me.spnColumns.focus();
break;
case 5:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);

View file

@ -101,6 +101,7 @@ define([
style: 'width: 100%;', style: 'width: 100%;',
menuStyle: 'min-width: 218px;', menuStyle: 'min-width: 218px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{value:0, displayValue: this.txtStandard , size: [254, 190.5]}, {value:0, displayValue: this.txtStandard , size: [254, 190.5]},
{value:1, displayValue: this.txtWidescreen1 , size: [254, 143]}, {value:1, displayValue: this.txtWidescreen1 , size: [254, 143]},
@ -179,6 +180,7 @@ define([
style: 'width: 100%;', style: 'width: 100%;',
menuStyle: 'min-width: 218px;', menuStyle: 'min-width: 218px;',
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{value:0, displayValue: this.strPortrait}, {value:0, displayValue: this.strPortrait},
{value:1, displayValue: this.strLandscape} {value:1, displayValue: this.strLandscape}
@ -202,6 +204,14 @@ define([
this.updateMetricUnit(); this.updateMetricUnit();
}, },
getFocusedComponents: function() {
return [this.cmbSlideSize, this.spnWidth, this.spnHeight, this.cmbSlideOrientation];
},
getDefaultFocusableComponent: function () {
return this.cmbSlideSize;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) { if (this.options.handler) {
this.options.handler.call(this, this, state); this.options.handler.call(this, this, state);

View file

@ -315,6 +315,33 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight,
this.spnTableMarginTop, this.spnTableMarginLeft, this.spnTableMarginBottom, this.spnTableMarginRight, // 0 tab
this.inputAltTitle, this.textareaAltDescription // 1 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
switch (index) {
case 0:
if (!me.spnMarginTop.isDisabled())
me.spnMarginTop.focus();
else
me.spnTableMarginTop.focus();
break;
case 1:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);

View file

@ -521,6 +521,9 @@ define([
handler: handlerDlg handler: handlerDlg
}).on('close', function() { }).on('close', function() {
panel.show(); panel.show();
_.delay(function(){
txtRange.focus();
},1);
}); });
var xy = panel.$window.offset(); var xy = panel.$window.offset();
@ -544,6 +547,9 @@ define([
panel.dataRangeTop = value; panel.dataRangeTop = value;
else else
panel.dataRangeLeft = value; panel.dataRangeLeft = value;
_.delay(function(){
txtRange.focus();
},1);
} }
}, },

View file

@ -98,6 +98,14 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.inputDecimalSeparator, this.inputThousandsSeparator];
},
getDefaultFocusableComponent: function () {
return this.inputDecimalSeparator;
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
}, },
@ -109,15 +117,6 @@ define([
} }
}, },
show: function() {
Common.UI.Window.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.inputDecimalSeparator.cmpEl.find('input').focus();
},50);
},
onPrimary: function(event) { onPrimary: function(event) {
this._handleInput('ok'); this._handleInput('ok');
return false; return false;

View file

@ -123,7 +123,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
data : this.conditions, data : this.conditions,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals); this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals);
@ -135,7 +136,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
data : this.conditions, data : this.conditions,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbCondition2.setValue(0); this.cmbCondition2.setValue(0);
@ -157,7 +159,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 225px;max-height: 135px;', menuStyle : 'min-width: 225px;max-height: 135px;',
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data : [] data : [],
takeFocusOnClose: true
}); });
this.cmbValue2 = new Common.UI.ComboBox({ this.cmbValue2 = new Common.UI.ComboBox({
@ -165,7 +168,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'min-width: 225px;max-height: 135px;', menuStyle : 'min-width: 225px;max-height: 135px;',
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
data : [] data : [],
takeFocusOnClose: true
}); });
var comparator = function(item1, item2) { var comparator = function(item1, item2) {
@ -184,15 +188,13 @@ define([
this.loadDefaults(); this.loadDefaults();
}, },
show: function () {
Common.UI.Window.prototype.show.call(this);
var me = this; getFocusedComponents: function() {
_.defer(function () { return [this.cmbCondition1, this.cmbValue1, this.cmbCondition2, this.cmbValue2];
if (me.cmbValue1) { },
me.cmbValue1._input.focus();
} getDefaultFocusableComponent: function () {
}, 500); return this.cmbValue1;
}, },
close: function () { close: function () {
@ -352,7 +354,8 @@ define([
{ value: true, displayValue: this.txtTop }, { value: true, displayValue: this.txtTop },
{ value: false, displayValue: this.txtBottom } { value: false, displayValue: this.txtBottom }
], ],
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbType.setValue(true); this.cmbType.setValue(true);
@ -368,7 +371,8 @@ define([
menuStyle : 'min-width: 85px;', menuStyle : 'min-width: 85px;',
cls : 'input-group-nr', cls : 'input-group-nr',
data : data, data : data,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbItem.setValue(false); this.cmbItem.setValue(false);
this.cmbItem.on('selected', _.bind(function(combo, record) { this.cmbItem.on('selected', _.bind(function(combo, record) {
@ -392,7 +396,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
data : [], data : [],
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbFields.setVisible(this.type=='value'); this.cmbFields.setVisible(this.type=='value');
(this.type!=='value') && this.$window.find('#id-top10-lblby').addClass('hidden'); (this.type!=='value') && this.$window.find('#id-top10-lblby').addClass('hidden');
@ -401,15 +406,13 @@ define([
this.loadDefaults(); this.loadDefaults();
}, },
show: function () {
Common.UI.Window.prototype.show.call(this);
var me = this; getFocusedComponents: function() {
_.defer(function () { return [this.cmbType, this.spnCount, this.cmbItem, this.cmbFields];
if (me.spnCount) { },
me.spnCount.$input.focus();
} getDefaultFocusableComponent: function () {
}, 500); return this.spnCount;
}, },
close: function () { close: function () {
@ -582,7 +585,8 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
data : this.conditions, data : this.conditions,
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals); this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals);
this.cmbCondition1.on('selected', _.bind(function(combo, record) { this.cmbCondition1.on('selected', _.bind(function(combo, record) {
@ -593,7 +597,7 @@ define([
var me = this; var me = this;
_.defer(function () { _.defer(function () {
if (me.inputValue) { if (me.inputValue) {
me.inputValue._input.focus(); me.inputValue.focus();
} }
}, 10); }, 10);
}, this)); }, this));
@ -605,14 +609,15 @@ define([
cls : 'input-group-nr', cls : 'input-group-nr',
data : [], data : [],
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbFields.setVisible(this.type=='value'); this.cmbFields.setVisible(this.type=='value');
this.cmbFields.on('selected', _.bind(function(combo, record) { this.cmbFields.on('selected', _.bind(function(combo, record) {
var me = this; var me = this;
_.defer(function () { _.defer(function () {
if (me.inputValue) { if (me.inputValue) {
me.inputValue._input.focus(); me.inputValue.focus();
} }
}, 10); }, 10);
}, this)); }, this));
@ -637,15 +642,13 @@ define([
this.loadDefaults(); this.loadDefaults();
}, },
show: function () {
Common.UI.Window.prototype.show.call(this);
var me = this; getFocusedComponents: function() {
_.defer(function () { return [this.cmbFields, this.cmbCondition1, this.inputValue, this.inputValue2];
if (me.inputValue) { },
me.inputValue._input.focus();
} getDefaultFocusableComponent: function () {
}, 500); return this.inputValue;
}, },
close: function () { close: function () {
@ -1352,7 +1355,7 @@ define([
var me = this; var me = this;
if (this.input) { if (this.input) {
_.delay(function () { _.delay(function () {
me.input.$el.find('input').focus(); me.input.focus();
}, 500, this); }, 500, this);
} }
}, },
@ -1612,7 +1615,7 @@ define([
this.updateCellCheck(listView, record); this.updateCellCheck(listView, record);
_.delay(function () { _.delay(function () {
listView.$el.find('.listview').focus(); listView.focus();
}, 100, this); }, 100, this);
} }
} }
@ -1955,7 +1958,7 @@ define([
callback: function() { callback: function() {
me._skipCheckDocumentClick = false; me._skipCheckDocumentClick = false;
_.delay(function () { _.delay(function () {
me.input.$el.find('input').focus(); me.input.focus();
}, 100, this); }, 100, this);
} }
}); });

View file

@ -170,10 +170,16 @@ define([
this.lblRange3 = $window.find('#id-dlg-chart-range-lbl3'); this.lblRange3 = $window.find('#id-dlg-chart-range-lbl3');
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
},
_.defer(function(){ getFocusedComponents: function() {
me.inputRange1.cmpEl.find('input').focus(); return [this.inputRange1, this.inputRange2, this.inputRange3];
}, 10); },
getDefaultFocusableComponent: function () {
if (this._alreadyRendered) return; // focus only at first show
this._alreadyRendered = true;
return this.inputRange1;
}, },
onPrimary: function() { onPrimary: function() {
@ -237,7 +243,7 @@ define([
me.show(); me.show();
_.delay(function(){ _.delay(function(){
me._noApply = true; me._noApply = true;
input.cmpEl.find('input').focus(); input.focus();
me._noApply = false; me._noApply = false;
},1); },1);
}); });

View file

@ -168,7 +168,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscChartTitleShowSettings.none, displayValue: this.textNone }, { value: Asc.c_oAscChartTitleShowSettings.none, displayValue: this.textNone },
{ value: Asc.c_oAscChartTitleShowSettings.overlay, displayValue: this.textOverlay }, { value: Asc.c_oAscChartTitleShowSettings.overlay, displayValue: this.textOverlay },
{ value: Asc.c_oAscChartTitleShowSettings.noOverlay, displayValue: this.textNoOverlay } { value: Asc.c_oAscChartTitleShowSettings.noOverlay, displayValue: this.textNoOverlay }
] ],
takeFocusOnClose: true
}); });
this.cmbLegendPos = new Common.UI.ComboBox({ this.cmbLegendPos = new Common.UI.ComboBox({
@ -184,7 +185,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscChartLegendShowSettings.left, displayValue: this.textLegendLeft }, { value: Asc.c_oAscChartLegendShowSettings.left, displayValue: this.textLegendLeft },
{ value: Asc.c_oAscChartLegendShowSettings.leftOverlay, displayValue: this.textLeftOverlay }, { value: Asc.c_oAscChartLegendShowSettings.leftOverlay, displayValue: this.textLeftOverlay },
{ value: Asc.c_oAscChartLegendShowSettings.rightOverlay, displayValue: this.textRightOverlay } { value: Asc.c_oAscChartLegendShowSettings.rightOverlay, displayValue: this.textRightOverlay }
] ],
takeFocusOnClose: true
}); });
this.cmbHorTitle = new Common.UI.ComboBox({ this.cmbHorTitle = new Common.UI.ComboBox({
@ -195,7 +197,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{ value: Asc.c_oAscChartHorAxisLabelShowSettings.none, displayValue: this.textNone }, { value: Asc.c_oAscChartHorAxisLabelShowSettings.none, displayValue: this.textNone },
{ value: Asc.c_oAscChartHorAxisLabelShowSettings.noOverlay, displayValue: this.textNoOverlay } { value: Asc.c_oAscChartHorAxisLabelShowSettings.noOverlay, displayValue: this.textNoOverlay }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putHorAxisLabel(record.value); this.chartSettings.putHorAxisLabel(record.value);
@ -210,7 +213,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscChartVertAxisLabelShowSettings.none, displayValue: this.textNone }, { value: Asc.c_oAscChartVertAxisLabelShowSettings.none, displayValue: this.textNone },
{ value: Asc.c_oAscChartVertAxisLabelShowSettings.rotated, displayValue: this.textRotated }, { value: Asc.c_oAscChartVertAxisLabelShowSettings.rotated, displayValue: this.textRotated },
{ value: Asc.c_oAscChartVertAxisLabelShowSettings.horizontal, displayValue: this.textHorizontal } { value: Asc.c_oAscChartVertAxisLabelShowSettings.horizontal, displayValue: this.textHorizontal }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putVertAxisLabel(record.value); this.chartSettings.putVertAxisLabel(record.value);
@ -224,7 +228,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{ value: true, displayValue: this.textShow }, { value: true, displayValue: this.textShow },
{ value: false, displayValue: this.textHide } { value: false, displayValue: this.textHide }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putShowHorAxis(record.value); this.chartSettings.putShowHorAxis(record.value);
@ -238,7 +243,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{ value: true, displayValue: this.textShow }, { value: true, displayValue: this.textShow },
{ value: false, displayValue: this.textHide } { value: false, displayValue: this.textHide }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putShowVerAxis(record.value); this.chartSettings.putShowVerAxis(record.value);
@ -254,7 +260,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscGridLinesSettings.major, displayValue: this.textMajor }, { value: Asc.c_oAscGridLinesSettings.major, displayValue: this.textMajor },
{ value: Asc.c_oAscGridLinesSettings.minor, displayValue: this.textMinor }, { value: Asc.c_oAscGridLinesSettings.minor, displayValue: this.textMinor },
{ value: Asc.c_oAscGridLinesSettings.majorMinor, displayValue: this.textMajorMinor } { value: Asc.c_oAscGridLinesSettings.majorMinor, displayValue: this.textMajorMinor }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putHorGridLines(record.value); this.chartSettings.putHorGridLines(record.value);
@ -270,7 +277,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscGridLinesSettings.major, displayValue: this.textMajor }, { value: Asc.c_oAscGridLinesSettings.major, displayValue: this.textMajor },
{ value: Asc.c_oAscGridLinesSettings.minor, displayValue: this.textMinor }, { value: Asc.c_oAscGridLinesSettings.minor, displayValue: this.textMinor },
{ value: Asc.c_oAscGridLinesSettings.majorMinor, displayValue: this.textMajorMinor } { value: Asc.c_oAscGridLinesSettings.majorMinor, displayValue: this.textMajorMinor }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) if (this.chartSettings)
this.chartSettings.putVertGridLines(record.value); this.chartSettings.putVertGridLines(record.value);
@ -287,7 +295,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: Asc.c_oAscChartDataLabelsPos.inBase, displayValue: this.textInnerBottom }, { value: Asc.c_oAscChartDataLabelsPos.inBase, displayValue: this.textInnerBottom },
{ value: Asc.c_oAscChartDataLabelsPos.inEnd, displayValue: this.textInnerTop }, { value: Asc.c_oAscChartDataLabelsPos.inEnd, displayValue: this.textInnerTop },
{ value: Asc.c_oAscChartDataLabelsPos.outEnd, displayValue: this.textOuterTop } { value: Asc.c_oAscChartDataLabelsPos.outEnd, displayValue: this.textOuterTop }
] ],
takeFocusOnClose: true
}); });
this.cmbDataLabels.on('selected', _.bind(me.onSelectDataLabels, this)); this.cmbDataLabels.on('selected', _.bind(me.onSelectDataLabels, this));
@ -324,7 +333,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{ value: 0, displayValue: this.textNone }, { value: 0, displayValue: this.textNone },
{ value: 1, displayValue: this.textStraight }, { value: 1, displayValue: this.textStraight },
{ value: 2, displayValue: this.textSmooth } { value: 2, displayValue: this.textSmooth }
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.chartSettings) { if (this.chartSettings) {
this.chartSettings.putLine(record.value!==0); this.chartSettings.putLine(record.value!==0);
@ -353,7 +363,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{displayValue: this.textAuto, value: Asc.c_oAscValAxisRule.auto}, {displayValue: this.textAuto, value: Asc.c_oAscValAxisRule.auto},
{displayValue: this.textFixed, value: Asc.c_oAscValAxisRule.fixed} {displayValue: this.textFixed, value: Asc.c_oAscValAxisRule.fixed}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMinValRule(record.value); this.currentAxisProps.putMinValRule(record.value);
@ -389,7 +400,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{displayValue: this.textAuto, value: Asc.c_oAscValAxisRule.auto}, {displayValue: this.textAuto, value: Asc.c_oAscValAxisRule.auto},
{displayValue: this.textFixed, value: Asc.c_oAscValAxisRule.fixed} {displayValue: this.textFixed, value: Asc.c_oAscValAxisRule.fixed}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMaxValRule(record.value); this.currentAxisProps.putMaxValRule(record.value);
@ -427,7 +439,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textValue, value: Asc.c_oAscCrossesRule.value}, {displayValue: this.textValue, value: Asc.c_oAscCrossesRule.value},
{displayValue: this.textMinValue, value: Asc.c_oAscCrossesRule.minValue}, {displayValue: this.textMinValue, value: Asc.c_oAscCrossesRule.minValue},
{displayValue: this.textMaxValue, value: Asc.c_oAscCrossesRule.maxValue} {displayValue: this.textMaxValue, value: Asc.c_oAscCrossesRule.maxValue}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putCrossesRule(record.value); this.currentAxisProps.putCrossesRule(record.value);
@ -480,7 +493,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textHundredMil, value: Asc.c_oAscValAxUnits.HUNDRED_MILLIONS}, {displayValue: this.textHundredMil, value: Asc.c_oAscValAxUnits.HUNDRED_MILLIONS},
{displayValue: this.textBillions, value: Asc.c_oAscValAxUnits.BILLIONS}, {displayValue: this.textBillions, value: Asc.c_oAscValAxUnits.BILLIONS},
{displayValue: this.textTrillions, value: Asc.c_oAscValAxUnits.TRILLIONS} {displayValue: this.textTrillions, value: Asc.c_oAscValAxUnits.TRILLIONS}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putDispUnitsRule(record.value); this.currentAxisProps.putDispUnitsRule(record.value);
@ -506,7 +520,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS}, {displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS},
{displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN}, {displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN},
{displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT} {displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMajorTickMark(record.value); this.currentAxisProps.putMajorTickMark(record.value);
@ -523,7 +538,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS}, {displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS},
{displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN}, {displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN},
{displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT} {displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMinorTickMark(record.value); this.currentAxisProps.putMinorTickMark(record.value);
@ -540,7 +556,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textLow, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW}, {displayValue: this.textLow, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW},
{displayValue: this.textHigh, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH}, {displayValue: this.textHigh, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH},
{displayValue: this.textNextToAxis, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO} {displayValue: this.textNextToAxis, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putTickLabelsPos(record.value); this.currentAxisProps.putTickLabelsPos(record.value);
@ -559,7 +576,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textValue, value: Asc.c_oAscCrossesRule.value}, {displayValue: this.textValue, value: Asc.c_oAscCrossesRule.value},
{displayValue: this.textMinValue, value: Asc.c_oAscCrossesRule.minValue}, {displayValue: this.textMinValue, value: Asc.c_oAscCrossesRule.minValue},
{displayValue: this.textMaxValue, value: Asc.c_oAscCrossesRule.maxValue} {displayValue: this.textMaxValue, value: Asc.c_oAscCrossesRule.maxValue}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putCrossesRule(record.value); this.currentAxisProps.putCrossesRule(record.value);
@ -599,7 +617,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{displayValue: this.textOnTickMarks, value: Asc.c_oAscLabelsPosition.byDivisions}, {displayValue: this.textOnTickMarks, value: Asc.c_oAscLabelsPosition.byDivisions},
{displayValue: this.textBetweenTickMarks, value: Asc.c_oAscLabelsPosition.betweenDivisions} {displayValue: this.textBetweenTickMarks, value: Asc.c_oAscLabelsPosition.betweenDivisions}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putLabelsPosition(record.value); this.currentAxisProps.putLabelsPosition(record.value);
@ -625,7 +644,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS}, {displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS},
{displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN}, {displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN},
{displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT} {displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMajorTickMark(record.value); this.currentAxisProps.putMajorTickMark(record.value);
@ -642,7 +662,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS}, {displayValue: this.textCross, value: Asc.c_oAscTickMark.TICK_MARK_CROSS},
{displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN}, {displayValue: this.textIn, value: Asc.c_oAscTickMark.TICK_MARK_IN},
{displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT} {displayValue: this.textOut, value: Asc.c_oAscTickMark.TICK_MARK_OUT}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putMinorTickMark(record.value); this.currentAxisProps.putMinorTickMark(record.value);
@ -673,7 +694,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textLow, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW}, {displayValue: this.textLow, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_LOW},
{displayValue: this.textHigh, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH}, {displayValue: this.textHigh, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_HIGH},
{displayValue: this.textNextToAxis, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO} {displayValue: this.textNextToAxis, value: Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putTickLabelsPos(record.value); this.currentAxisProps.putTickLabelsPos(record.value);
@ -720,7 +742,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
data : [ data : [
{displayValue: this.textAuto, value: Asc.c_oAscBetweenLabelsRule.auto}, {displayValue: this.textAuto, value: Asc.c_oAscBetweenLabelsRule.auto},
{displayValue: this.textManual, value: Asc.c_oAscBetweenLabelsRule.manual} {displayValue: this.textManual, value: Asc.c_oAscBetweenLabelsRule.manual}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
if (this.currentAxisProps) { if (this.currentAxisProps) {
this.currentAxisProps.putIntervalBetweenLabelsRule(record.value); this.currentAxisProps.putIntervalBetweenLabelsRule(record.value);
@ -729,9 +752,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
} }
}, this)); }, this));
this.btnsCategory[2].on('click', _.bind(this.onVCategoryClick, this));
this.btnsCategory[3].on('click', _.bind(this.onHCategoryClick, this));
// Sparklines // Sparklines
this.btnSparkType = new Common.UI.Button({ this.btnSparkType = new Common.UI.Button({
cls : 'btn-large-dataview', cls : 'btn-large-dataview',
@ -821,7 +841,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
el : $('#spark-dlg-combo-empty'), el : $('#spark-dlg-combo-empty'),
menuStyle : 'min-width: 220px;', menuStyle : 'min-width: 220px;',
editable : false, editable : false,
cls : 'input-group-nr' cls : 'input-group-nr',
takeFocusOnClose: true
}); });
this.cmbEmptyCells.on('selected', _.bind(function(combo, record){ this.cmbEmptyCells.on('selected', _.bind(function(combo, record){
if (this._changedProps) { if (this._changedProps) {
@ -870,7 +891,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual}, {displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual},
{displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group}, {displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group},
{displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom} {displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
this.spnSparkMinValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom); this.spnSparkMinValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom);
if (this._changedProps) { if (this._changedProps) {
@ -903,7 +925,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
{displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual}, {displayValue: this.textAutoEach, value: Asc.c_oAscSparklineAxisMinMax.Individual},
{displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group}, {displayValue: this.textSameAll, value: Asc.c_oAscSparklineAxisMinMax.Group},
{displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom} {displayValue: this.textFixed, value: Asc.c_oAscSparklineAxisMinMax.Custom}
] ],
takeFocusOnClose: true
}).on('selected', _.bind(function(combo, record) { }).on('selected', _.bind(function(combo, record) {
this.spnSparkMaxValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom); this.spnSparkMaxValue.setDisabled(record.value!==Asc.c_oAscSparklineAxisMinMax.Custom);
if (this._changedProps) { if (this._changedProps) {
@ -974,6 +997,42 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.cmbChartTitle, this.cmbLegendPos, this.cmbDataLabels, this.txtSeparator, this.cmbHorShow, this.cmbVertShow,
this.cmbHorTitle, this.cmbVertTitle, this.cmbHorGrid, this.cmbVertGrid, // 1 tab
this.cmbMinType , this.spnMinValue, this.cmbMaxType, this.spnMaxValue, this.cmbVCrossType, this.spnVAxisCrosses,
this.cmbUnits , this.cmbVMajorType, this.cmbVMinorType, this.cmbVLabelPos, // 2 tab
this.cmbHCrossType , this.spnHAxisCrosses, this.cmbAxisPos, this.cmbHMajorType, this.cmbHMinorType, this.spnMarksInterval,
this.cmbHLabelPos , this.spnLabelDist, this.cmbLabelInterval, this.spnLabelInterval, // 3 tab
this.inputAltTitle, this.textareaAltDescription // 7 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
switch (index) {
case 1:
me.cmbChartTitle.focus();
break;
case 2:
me.onVCategoryClick(btn);
me.cmbMinType.focus();
break;
case 3:
me.onHCategoryClick(btn);
me.cmbHCrossType.focus();
break;
case 7:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.chartSettings); this._setDefaults(this.chartSettings);

View file

@ -164,17 +164,18 @@ define([
this.afterRender(); this.afterRender();
}, },
afterRender: function() { getFocusedComponents: function() {
this._setDefaults(this.props); return [this.txtSourceRange, this.txtDestRange];
}, },
show: function() { getDefaultFocusableComponent: function () {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); if (this._alreadyRendered) return; // focus only at first show
this._alreadyRendered = true;
return this.txtSourceRange;
},
var me = this; afterRender: function() {
_.delay(function(){ this._setDefaults(this.props);
me.txtSourceRange.cmpEl.find('input').focus();
},50);
}, },
_setDefaults: function (props) { _setDefaults: function (props) {
@ -257,6 +258,9 @@ define([
handler: handlerDlg handler: handlerDlg
}).on('close', function() { }).on('close', function() {
me.show(); me.show();
_.delay(function(){
txtRange.focus();
},1);
}); });
var xy = me.$window.offset(); var xy = me.$window.offset();

View file

@ -171,7 +171,8 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 264px;', menuStyle: 'min-width: 264px;',
editable: false, editable: false,
data: this.numFormatData data: this.numFormatData,
takeFocusOnClose: true
}); });
this.cmbFormat.setValue(this.FormatType); this.cmbFormat.setValue(this.FormatType);
this.cmbFormat.on('selected', _.bind(this.onFormatSelect, this)); this.cmbFormat.on('selected', _.bind(this.onFormatSelect, this));
@ -182,7 +183,8 @@ define([
menuStyle: 'min-width: 264px;max-height:235px;', menuStyle: 'min-width: 264px;max-height:235px;',
editable: false, editable: false,
data: [], data: [],
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}); });
this.cmbNegative.on('selected', _.bind(this.onNegativeSelect, this)); this.cmbNegative.on('selected', _.bind(this.onNegativeSelect, this));
@ -210,7 +212,8 @@ define([
menuStyle: 'min-width: 264px;max-height:235px;', menuStyle: 'min-width: 264px;max-height:235px;',
editable: false, editable: false,
data: [], data: [],
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}); });
this.cmbSymbols.on('selected', _.bind(this.onSymbolsSelect, this)); this.cmbSymbols.on('selected', _.bind(this.onSymbolsSelect, this));
@ -220,7 +223,8 @@ define([
menuStyle: 'min-width: 264px;max-height:235px;', menuStyle: 'min-width: 264px;max-height:235px;',
editable: false, editable: false,
data: [], data: [],
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}); });
this.cmbType.on('selected', _.bind(this.onTypeSelect, this)); this.cmbType.on('selected', _.bind(this.onTypeSelect, this));
@ -230,7 +234,8 @@ define([
menuStyle: 'min-width: 310px;max-height:235px;', menuStyle: 'min-width: 310px;max-height:235px;',
editable: false, editable: false,
data: [], data: [],
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}); });
this.cmbCode.on('selected', _.bind(this.onCodeSelect, this)); this.cmbCode.on('selected', _.bind(this.onCodeSelect, this));
@ -246,6 +251,14 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.cmbFormat, this.spnDecimal, this.cmbSymbols, this.cmbNegative, this.cmbType, this.cmbCode];
},
getDefaultFocusableComponent: function () {
return this.cmbFormat;
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
}, },
@ -489,7 +502,7 @@ define([
this.lblExample.text(this.api.asc_getLocaleExample(this.Format)); this.lblExample.text(this.api.asc_getLocaleExample(this.Format));
this._decimalPanel.toggleClass('hidden', !hasDecimal); this._decimalPanel.toggleClass('hidden', !hasDecimal);
this._negativePanel.css('visibility', hasNegative ? '' : 'hidden'); this._negativePanel.toggleClass('hidden', !hasNegative);
this._separatorPanel.toggleClass('hidden', !hasSeparator); this._separatorPanel.toggleClass('hidden', !hasSeparator);
this._typePanel.toggleClass('hidden', !hasType); this._typePanel.toggleClass('hidden', !hasType);
this._symbolsPanel.toggleClass('hidden', !hasSymbols); this._symbolsPanel.toggleClass('hidden', !hasSymbols);

View file

@ -123,6 +123,15 @@ define([
this.descLabel = $('#formula-dlg-desc'); this.descLabel = $('#formula-dlg-desc');
this.fillFormulasGroups(); this.fillFormulasGroups();
}, },
getFocusedComponents: function() {
return [this.inputSearch, this.cmbFuncGroup, {cmp: this.cmbListFunctions, selector: '.listview'}];
},
getDefaultFocusableComponent: function () {
return this.inputSearch;
},
show: function (group) { show: function (group) {
if (this.$window) { if (this.$window) {
var main_width, main_height, top, left, win_height = this.initConfig.height; var main_width, main_height, top, left, win_height = this.initConfig.height;
@ -147,12 +156,7 @@ define([
group && this.cmbFuncGroup.setValue(group); group && this.cmbFuncGroup.setValue(group);
(group || this.cmbFuncGroup.getValue()=='Last10') && this.fillFunctions(this.cmbFuncGroup.getValue()); (group || this.cmbFuncGroup.getValue()=='Last10') && this.fillFunctions(this.cmbFuncGroup.getValue());
if (this.cmbListFunctions) { this.inputSearch.setValue('');
this.inputSearch.setValue('');
_.delay(function (me) {
me.inputSearch.$el.find('input').focus();
}, 100, this);
}
this._preventCloseCellEditor = false; this._preventCloseCellEditor = false;
}, },
@ -211,7 +215,7 @@ define([
onUpdateFocus: function () { onUpdateFocus: function () {
if (this.cmbListFunctions) { if (this.cmbListFunctions) {
_.delay(function (me) { _.delay(function (me) {
me.cmbListFunctions.$el.find('.listview').focus(); me.cmbListFunctions.focus();
}, 100, this); }, 100, this);
} }
}, },
@ -242,9 +246,9 @@ define([
menuStyle : 'min-width: 100%;', menuStyle : 'min-width: 100%;',
cls : 'input-group-nr', cls : 'input-group-nr',
data : groupsListItems, data : groupsListItems,
editable : false editable : false,
takeFocusOnClose: true
}); });
this.cmbFuncGroup.on('selected', _.bind(this.onSelectGroup, this)); this.cmbFuncGroup.on('selected', _.bind(this.onSelectGroup, this));
} else { } else {
this.cmbFuncGroup.setData(groupsListItems); this.cmbFuncGroup.setData(groupsListItems);
@ -266,6 +270,7 @@ define([
this.cmbListFunctions = new Common.UI.ListView({ this.cmbListFunctions = new Common.UI.ListView({
el: $('#formula-dlg-combo-functions'), el: $('#formula-dlg-combo-functions'),
store: this.functions, store: this.functions,
tabindex: 1,
itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;"><%= value %></div>') itemTemplate: _.template('<div id="<%= id %>" class="list-item" style="pointer-events:none;"><%= value %></div>')
}); });

View file

@ -214,7 +214,7 @@ define([
_.delay(function(){ _.delay(function(){
me._noApply = true; me._noApply = true;
me.args[0].argInput.cmpEl.find('input').focus(); me.args[0].argInput.focus();
me._noApply = false; me._noApply = false;
},100); },100);
} }
@ -281,6 +281,8 @@ define([
else else
me.args[argcount].lblName.html(me.args[argcount].argName); me.args[argcount].lblName.html(me.args[argcount].argName);
me.args[argcount].lblValue.html('= '+ ( argres!==null && argres!==undefined ? argres : '<span style="opacity: 0.6; font-weight: bold;">' + me.args[argcount].argTypeName + '</span>')); me.args[argcount].lblValue.html('= '+ ( argres!==null && argres!==undefined ? argres : '<span style="opacity: 0.6; font-weight: bold;">' + me.args[argcount].argTypeName + '</span>'));
Common.UI.FocusManager.add(this, txt);
}, },
onInputChanging: function(input, newValue, oldValue, e) { onInputChanging: function(input, newValue, oldValue, e) {
@ -364,7 +366,7 @@ define([
me.show(); me.show();
_.delay(function(){ _.delay(function(){
me._noApply = true; me._noApply = true;
input.cmpEl.find('input').focus(); input.focus();
me._noApply = false; me._noApply = false;
},1); },1);
}); });

View file

@ -86,7 +86,7 @@ define([
'</div>', '</div>',
'</div>', '</div>',
'</div>', '</div>',
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 115px;border: 1px solid #cfcfcf;"></div>', '<div id="id-dlg-hyperlink-list" style="width:100%; height: 115px;"></div>',
'<div class="input-row">', '<div class="input-row">',
'<label>' + this.strRange + '</label>', '<label>' + this.strRange + '</label>',
'</div>', '</div>',
@ -202,6 +202,7 @@ define([
me.internalList = new Common.UI.TreeView({ me.internalList = new Common.UI.TreeView({
el: $('#id-dlg-hyperlink-list'), el: $('#id-dlg-hyperlink-list'),
store: new Common.UI.TreeViewStore(), store: new Common.UI.TreeViewStore(),
tabindex: 1,
enableKeyEvents: true enableKeyEvents: true
}); });
me.internalList.on('item:select', _.bind(this.onSelectItem, this)); me.internalList.on('item:select', _.bind(this.onSelectItem, this));
@ -250,13 +251,8 @@ define([
me.internalPanel = $window.find('#id-internal-link'); me.internalPanel = $window.find('#id-internal-link');
}, },
show: function() { getFocusedComponents: function() {
Common.UI.Window.prototype.show.apply(this, arguments); return [this.inputUrl, {cmp: this.internalList, selector: '.treeview'}, this.inputRange, this.inputDisplay, this.inputTip];
var me = this;
_.delay(function(){
if (me.focusedInput) me.focusedInput.focus();
},50);
}, },
setSettings: function(settings) { setSettings: function(settings) {
@ -273,13 +269,11 @@ define([
var defrange = ''; var defrange = '';
if (!settings.props) { // add link if (!settings.props) { // add link
this.inputDisplay.setValue(settings.isLock ? this.textDefault : settings.text); this.inputDisplay.setValue(settings.isLock ? this.textDefault : settings.text);
this.focusedInput = (type == Asc.c_oAscHyperlinkType.WebLink) ? this.inputUrl.cmpEl.find('input') : this.inputRange.cmpEl.find('input');
} else { } else {
if (type == Asc.c_oAscHyperlinkType.RangeLink) { if (type == Asc.c_oAscHyperlinkType.RangeLink) {
if (settings.props.asc_getSheet()) { if (settings.props.asc_getSheet()) {
this.inputRange.setValue(settings.props.asc_getRange()); this.inputRange.setValue(settings.props.asc_getRange());
this.dataRangeValid = this.inputRange.getValue(); this.dataRangeValid = this.inputRange.getValue();
this.focusedInput = this.inputRange.cmpEl.find('input');
defrange = settings.props.asc_getSheet() + '!' + settings.props.asc_getRange(); defrange = settings.props.asc_getSheet() + '!' + settings.props.asc_getRange();
} else {// named range } else {// named range
this.inputRange.setDisabled(true); this.inputRange.setDisabled(true);
@ -287,7 +281,6 @@ define([
} }
} else { } else {
this.inputUrl.setValue(settings.props.asc_getHyperlinkUrl().replace(new RegExp(" ",'g'), "%20")); this.inputUrl.setValue(settings.props.asc_getHyperlinkUrl().replace(new RegExp(" ",'g'), "%20"));
this.focusedInput = this.inputUrl.cmpEl.find('input');
this.btnOk.setDisabled($.trim(this.inputUrl.getValue())==''); this.btnOk.setDisabled($.trim(this.inputUrl.getValue())=='');
} }
this.inputDisplay.setValue(settings.isLock ? this.textDefault : settings.props.asc_getText()); this.inputDisplay.setValue(settings.isLock ? this.textDefault : settings.props.asc_getText());
@ -356,17 +349,17 @@ define([
checkrange = (this.btnInternal.isActive()) ? this.inputRange.checkValidate() : true, checkrange = (this.btnInternal.isActive()) ? this.inputRange.checkValidate() : true,
checkdisp = this.inputDisplay.checkValidate(); checkdisp = this.inputDisplay.checkValidate();
if (checkurl !== true) { if (checkurl !== true) {
this.inputUrl.cmpEl.find('input').focus(); this.inputUrl.focus();
this.isInputFirstChange_url = true; this.isInputFirstChange_url = true;
return; return;
} }
if (checkrange !== true) { if (checkrange !== true) {
this.inputRange.cmpEl.find('input').focus(); this.inputRange.focus();
this.isInputFirstChange_range = true; this.isInputFirstChange_range = true;
return; return;
} }
if (checkdisp !== true) { if (checkdisp !== true) {
this.inputDisplay.cmpEl.find('input').focus(); this.inputDisplay.focus();
return; return;
} }
!this.settings.props && Common.Utils.InternalSettings.set("sse-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink !this.settings.props && Common.Utils.InternalSettings.set("sse-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink
@ -448,8 +441,20 @@ define([
} }
var rec = this.internalList.getSelectedRec(); var rec = this.internalList.getSelectedRec();
this.btnOk.setDisabled(!rec || rec.get('level')==0 || rec.get('type')==0 && $.trim(this.inputRange.getValue())==''); this.btnOk.setDisabled(!rec || rec.get('level')==0 || rec.get('type')==0 && $.trim(this.inputRange.getValue())=='');
} else var me = this;
_.delay(function(){
if (me.inputRange.isDisabled())
me.internalList.focus();
else
me.inputRange.focus();
},50);
} else {
this.btnOk.setDisabled($.trim(this.inputUrl.getValue())==''); this.btnOk.setDisabled($.trim(this.inputUrl.getValue())=='');
var me = this;
_.delay(function(){
me.inputUrl.focus();
},50);
}
}, },
onLinkTypeClick: function(type, btn, event) { onLinkTypeClick: function(type, btn, event) {
@ -521,6 +526,9 @@ define([
handler: handlerDlg handler: handlerDlg
}).on('close', function() { }).on('close', function() {
me.show(); me.show();
_.delay(function(){
me.inputRange.focus();
},1);
}); });
var xy = me.$window.offset(); var xy = me.$window.offset();

View file

@ -146,6 +146,29 @@ define([ 'text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.temp
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.spnAngle, // 0 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.spnAngle.focus();
break;
case 2:
me.inputAltTitle.focus();
break;
}
}, 10);
},
onRadioSnapChange: function(field, newValue, eOpts) { onRadioSnapChange: function(field, newValue, eOpts) {
if (newValue && this._changedProps) { if (newValue && this._changedProps) {
this._changedProps.asc_putAnchor(field.options.value); this._changedProps.asc_putAnchor(field.options.value);

View file

@ -107,7 +107,8 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
{ value: 2, displayValue: this.textFilterTableNames }, { value: 2, displayValue: this.textFilterTableNames },
{ value: 3, displayValue: this.textFilterSheet }, { value: 3, displayValue: this.textFilterSheet },
{ value: 4, displayValue: this.textFilterWorkbook } { value: 4, displayValue: this.textFilterWorkbook }
] ],
takeFocusOnClose: true
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
me.refreshRangeList(null, 0); me.refreshRangeList(null, 0);
}); });
@ -129,7 +130,8 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
'<div class="lock-user"><%=lockuser%></div>', '<div class="lock-user"><%=lockuser%></div>',
'<% } %>', '<% } %>',
'</div>' '</div>'
].join('')) ].join('')),
tabindex: 1
}); });
this.rangeList.store.comparator = function(item1, item2) { this.rangeList.store.comparator = function(item1, item2) {
var n1 = item1.get(me.sort.type).toLowerCase(), var n1 = item1.get(me.sort.type).toLowerCase(),
@ -169,6 +171,14 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [ this.cmbFilter, {cmp: this.rangeList, selector: '.listview'} ];
},
getDefaultFocusableComponent: function () {
return this.rangeList;
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
}, },
@ -250,7 +260,6 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
this.rangeList.cmpEl.on('mouseover', _.bind(me.onMouseOverLock, me)).on('mouseout', _.bind(me.onMouseOutLock, me)); this.rangeList.cmpEl.on('mouseover', _.bind(me.onMouseOverLock, me)).on('mouseout', _.bind(me.onMouseOutLock, me));
} }
_.delay(function () { _.delay(function () {
me.rangeList.cmpEl.find('.listview').focus();
me.rangeList.scroller.update({alwaysVisibleY: true}); me.rangeList.scroller.update({alwaysVisibleY: true});
}, 100, this); }, 100, this);
}, },
@ -310,9 +319,6 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
} }
}).on('close', function() { }).on('close', function() {
me.show(); me.show();
_.delay(function () {
me.rangeList.cmpEl.find('.listview').focus();
}, 100, me);
}); });
me.hide(); me.hide();

View file

@ -150,7 +150,8 @@ define([
menuStyle : 'min-width: 100%;max-height: 280px;', menuStyle : 'min-width: 100%;max-height: 280px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [] data : [],
takeFocusOnClose: true
}); });
this.txtDataRange = new Common.UI.InputFieldBtn({ this.txtDataRange = new Common.UI.InputFieldBtn({
@ -170,10 +171,20 @@ define([
} }
}); });
this.txtDataRange.on('button:click', _.bind(this.onSelectData, this)); this.txtDataRange.on('button:click', _.bind(this.onSelectData, this));
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.inputName, this.cmbScope, this.txtDataRange];
},
getDefaultFocusableComponent: function () {
if (this._alreadyRendered) return; // focus only at first show
this._alreadyRendered = true;
return this.inputName;
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
this.setTitle((this.isEdit) ? this.txtTitleEdit : this.txtTitleNew); this.setTitle((this.isEdit) ? this.txtTitleEdit : this.txtTitleNew);
@ -184,11 +195,6 @@ define([
show: function() { show: function() {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
var me = this;
_.delay(function(){
me.inputName.cmpEl.find('input').focus();
},200);
}, },
_setDefaults: function (props) { _setDefaults: function (props) {
@ -227,6 +233,9 @@ define([
handler: handlerDlg handler: handlerDlg
}).on('close', function() { }).on('close', function() {
me.show(); me.show();
_.delay(function(){
me.txtDataRange.focus();
},1);
}); });
var xy = me.$window.offset(); var xy = me.$window.offset();
@ -268,12 +277,12 @@ define([
var checkname = this.inputName.checkValidate(), var checkname = this.inputName.checkValidate(),
checkrange = this.txtDataRange.checkValidate(); checkrange = this.txtDataRange.checkValidate();
if (checkname !== true) { if (checkname !== true) {
this.inputName.cmpEl.find('input').focus(); this.inputName.focus();
this.isInputFirstChange = true; this.isInputFirstChange = true;
return; return;
} }
if (checkrange !== true) { if (checkrange !== true) {
this.txtDataRange.cmpEl.find('input').focus(); this.txtDataRange.focus();
return; return;
} }
this.handler && this.handler.call(this, state, (state == 'ok') ? this.getSettings() : undefined); this.handler && this.handler.call(this, state, (state == 'ok') ? this.getSettings() : undefined);

View file

@ -141,7 +141,7 @@ define([
this.rangeList.scroller.update({alwaysVisibleY: true}); this.rangeList.scroller.update({alwaysVisibleY: true});
_.delay(function () { _.delay(function () {
me.rangeList.cmpEl.find('.listview').focus(); me.rangeList.focus();
}, 100, this); }, 100, this);
} }
}, },

View file

@ -149,6 +149,14 @@ define([
this.updateMetricUnit(); this.updateMetricUnit();
}, },
getFocusedComponents: function() {
return this.spinners;
},
getDefaultFocusableComponent: function () {
return this.spnTop;
},
_handleInput: function(state) { _handleInput: function(state) {
if (this.options.handler) if (this.options.handler)
this.options.handler.call(this, this, state); this.options.handler.call(this, this, state);

View file

@ -127,7 +127,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
editable: false, editable: false,
data: this._arrTextAlignment, data: this._arrTextAlignment,
style: 'width: 173px;', style: 'width: 173px;',
menuStyle : 'min-width: 173px;' menuStyle : 'min-width: 173px;',
takeFocusOnClose: true
}); });
this.cmbTextAlignment.setValue(''); this.cmbTextAlignment.setValue('');
@ -176,7 +177,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
editable: false, editable: false,
data: this._arrSpecial, data: this._arrSpecial,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbSpecial.setValue(''); this.cmbSpecial.setValue('');
this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this)); this.cmbSpecial.on('selected', _.bind(this.onSpecialSelect, this));
@ -240,7 +242,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
editable: false, editable: false,
data: this._arrLineRule, data: this._arrLineRule,
style: 'width: 85px;', style: 'width: 85px;',
menuStyle : 'min-width: 85px;' menuStyle : 'min-width: 85px;',
takeFocusOnClose: true
}); });
this.cmbLineRule.setValue(this.CurLineRuleIdx); this.cmbLineRule.setValue(this.CurLineRuleIdx);
this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this)); this.cmbLineRule.on('selected', _.bind(this.onLineRuleSelect, this));
@ -355,7 +358,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
'<div style="width: 117px;display: inline-block;"><%= value %></div>', '<div style="width: 117px;display: inline-block;"><%= value %></div>',
'<div style="display: inline-block;"><%= displayTabAlign %></div>', '<div style="display: inline-block;"><%= displayTabAlign %></div>',
'</div>' '</div>'
].join('')) ].join('')),
tabindex: 1
}); });
this.tabList.store.comparator = function(rec) { this.tabList.store.comparator = function(rec) {
return rec.get("tabPos"); return rec.get("tabPos");
@ -376,7 +380,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
menuStyle : 'min-width: 108px;', menuStyle : 'min-width: 108px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : this._arrTabAlign data : this._arrTabAlign,
takeFocusOnClose: true
}); });
this.cmbAlign.setValue(Asc.c_oAscTabType.Left); this.cmbAlign.setValue(Asc.c_oAscTabType.Left);
@ -395,13 +400,37 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
}); });
this.btnRemoveAll.on('click', _.bind(this.removeAllTabs, this)); this.btnRemoveAll.on('click', _.bind(this.removeAllTabs, this));
this.on('show', function(obj) {
obj.getChild('.footer .primary').focus();
});
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.cmbTextAlignment, this.numIndentsLeft, this.numIndentsRight, this.cmbSpecial, this.numSpecialBy,
this.numSpacingBefore, this.numSpacingAfter, this.cmbLineRule, this.numLineHeight, // 0 tab
this.numSpacing, // 1 tab
this.numDefaultTab, this.numTab, this.cmbAlign, {cmp: this.tabList, selector: '.listview'} // 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.cmbTextAlignment.focus();
break;
case 1:
me.numSpacing.focus();
break;
case 2:
me.numDefaultTab.focus();
break;
}
}, 10);
},
getSettings: function() { getSettings: function() {
if ( this._tabListChanged ) { if ( this._tabListChanged ) {
if (this._changedProps.asc_getTabs()===null || this._changedProps.asc_getTabs()===undefined) if (this._changedProps.asc_getTabs()===null || this._changedProps.asc_getTabs()===undefined)

View file

@ -103,7 +103,7 @@ define([
el: $('#pivot-list-fields'), el: $('#pivot-list-fields'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
simpleAddMode: true, simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')), template: _.template(['<div class="listview inner no-focus" style=""></div>'].join('')),
itemTemplate: _.template([ itemTemplate: _.template([
'<div>', '<div>',
'<label class="checkbox-indeterminate" style="position:absolute;">', '<label class="checkbox-indeterminate" style="position:absolute;">',
@ -139,7 +139,7 @@ define([
el: $('#pivot-list-columns'), el: $('#pivot-list-columns'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
simpleAddMode: true, simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')), template: _.template(['<div class="listview inner no-focus" style=""></div>'].join('')),
itemTemplate: itemTemplate itemTemplate: itemTemplate
}); });
this.columnsList.on('item:click', _.bind(this.onColumnsSelect, this, 0)); this.columnsList.on('item:click', _.bind(this.onColumnsSelect, this, 0));
@ -154,7 +154,7 @@ define([
el: $('#pivot-list-rows'), el: $('#pivot-list-rows'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
simpleAddMode: true, simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')), template: _.template(['<div class="listview inner no-focus" style=""></div>'].join('')),
itemTemplate: itemTemplate itemTemplate: itemTemplate
}); });
this.rowsList.on('item:click', _.bind(this.onColumnsSelect, this, 1)); this.rowsList.on('item:click', _.bind(this.onColumnsSelect, this, 1));
@ -169,7 +169,7 @@ define([
el: $('#pivot-list-values'), el: $('#pivot-list-values'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
simpleAddMode: true, simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')), template: _.template(['<div class="listview inner no-focus" style=""></div>'].join('')),
itemTemplate: itemTemplate itemTemplate: itemTemplate
}); });
this.valuesList.on('item:click', _.bind(this.onColumnsSelect, this, 2)); this.valuesList.on('item:click', _.bind(this.onColumnsSelect, this, 2));
@ -184,7 +184,7 @@ define([
el: $('#pivot-list-filters'), el: $('#pivot-list-filters'),
store: new Common.UI.DataViewStore(), store: new Common.UI.DataViewStore(),
simpleAddMode: true, simpleAddMode: true,
template: _.template(['<div class="listview inner" style=""></div>'].join('')), template: _.template(['<div class="listview inner no-focus" style=""></div>'].join('')),
itemTemplate: itemTemplate itemTemplate: itemTemplate
}); });
this.filtersList.on('item:click', _.bind(this.onColumnsSelect, this,3)); this.filtersList.on('item:click', _.bind(this.onColumnsSelect, this,3));

View file

@ -181,6 +181,33 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.inputName, this.numWrap, // 0 tab
this.txtDataRange, // 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.inputName.focus();
break;
case 1:
me.txtDataRange.focus();
break;
case 2:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this._setDefaults(this.props); this._setDefaults(this.props);
if (this.storageName) { if (this.storageName) {

View file

@ -93,6 +93,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
style : 'width: 132px;', style : 'width: 132px;',
menuStyle : 'min-width: 132px;max-height: 280px;', menuStyle : 'min-width: 132px;max-height: 280px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: Asc.c_oAscPrintType.ActiveSheets, displayValue: this.textCurrentSheet }, { value: Asc.c_oAscPrintType.ActiveSheets, displayValue: this.textCurrentSheet },
@ -113,7 +114,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
menuStyle : 'min-width: 242px;max-height: 280px;', menuStyle : 'min-width: 242px;max-height: 280px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [] data : [],
takeFocusOnClose: true
}); });
this.cmbPaperSize = new Common.UI.ComboBox({ this.cmbPaperSize = new Common.UI.ComboBox({
@ -121,6 +123,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
style : 'width: 242px;', style : 'width: 242px;',
menuStyle : 'max-height: 280px; min-width: 242px;', menuStyle : 'max-height: 280px; min-width: 242px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{value:'215.9|279.4', displayValue:'US Letter (21,59cm x 27,94cm)', caption: 'US Letter'}, {value:'215.9|279.4', displayValue:'US Letter (21,59cm x 27,94cm)', caption: 'US Letter'},
@ -144,6 +147,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
style : 'width: 132px;', style : 'width: 132px;',
menuStyle : 'min-width: 132px;', menuStyle : 'min-width: 132px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: Asc.c_oAscPageOrientation.PagePortrait, displayValue: this.strPortrait }, { value: Asc.c_oAscPageOrientation.PagePortrait, displayValue: this.strPortrait },
@ -218,6 +222,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
style : 'width: 242px;', style : 'width: 242px;',
menuStyle : 'min-width: 242px;', menuStyle : 'min-width: 242px;',
editable : false, editable : false,
takeFocusOnClose: true,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{ value: 0, displayValue: this.textActualSize }, { value: 0, displayValue: this.textActualSize },
@ -273,6 +278,17 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
this.handlerShowDetails(this.btnHide); this.handlerShowDetails(this.btnHide);
}, },
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];
},
getDefaultFocusableComponent: function () {
if (this._alreadyRendered) return; // focus only at first show
this._alreadyRendered = true;
return this.cmbRange;
},
addCustomScale: function (add) { addCustomScale: function (add) {
if (add) { if (add) {
this.cmbLayout.setData([ this.cmbLayout.setData([

View file

@ -186,13 +186,23 @@ define([
this.setSettings(); this.setSettings();
}, },
getFocusedComponents: function() {
return [this.txtRangeTop, this.txtRangeLeft];
},
getDefaultFocusableComponent: function () {
if (this._alreadyRendered) return; // focus only at first show
this._alreadyRendered = true;
return this.txtRangeTop;
},
isRangeValid: function() { isRangeValid: function() {
if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeTop.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) { if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeTop.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) {
this.txtRangeTop.cmpEl.find('input').focus(); this.txtRangeTop.focus();
return false; return false;
} }
if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeLeft.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) { if (this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PrintTitles, this.txtRangeLeft.getValue(), false) == Asc.c_oAscError.ID.DataRangeError) {
this.txtRangeLeft.cmpEl.find('input').focus(); this.txtRangeLeft.focus();
return false; return false;
} }
return true; return true;
@ -260,6 +270,9 @@ define([
handler: handlerDlg handler: handlerDlg
}).on('close', function() { }).on('close', function() {
me.show(); me.show();
_.delay(function(){
txtRange.focus();
},1);
}); });
var xy = me.$window.offset(); var xy = me.$window.offset();
@ -279,6 +292,9 @@ define([
this.dataRangeTop = value; this.dataRangeTop = value;
else else
this.dataRangeLeft = value; this.dataRangeLeft = value;
_.delay(function(){
txtRange.focus();
},1);
} }
}, },

View file

@ -120,7 +120,7 @@ define([
'item:select': this.onCellCheck.bind(this) 'item:select': this.onCellCheck.bind(this)
}); });
this.columnsList.onKeyDown = _.bind(this.onListKeyDown, this); this.columnsList.onKeyDown = _.bind(this.onListKeyDown, this);
this.columnsList.on('entervalue', _.bind(this.onPrimary, this));
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.afterRender(); this.afterRender();
}, },
@ -198,7 +198,7 @@ define([
this.updateCellCheck(listView, record); this.updateCellCheck(listView, record);
_.delay(function () { _.delay(function () {
listView.$el.find('.listview').focus(); listView.focus();
}, 100, this); }, 100, this);
} }
} }
@ -258,6 +258,10 @@ define([
this.chHeaders.setValue(!!props.asc_getHasHeaders(), true); this.chHeaders.setValue(!!props.asc_getHasHeaders(), true);
this.updateColumnsList(); this.updateColumnsList();
} }
var me = this;
_.delay(function () {
me.columnsList.focus();
}, 100, this);
}, },
getSettings: function () { getSettings: function () {

View file

@ -126,7 +126,8 @@ define([
menuStyle : 'min-width: 90px;', menuStyle : 'min-width: 90px;',
editable: true, editable: true,
data: this.arrDataScale, data: this.arrDataScale,
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}).on('selected', _.bind(this.changeWidthHeight, this, 'width')) }).on('selected', _.bind(this.changeWidthHeight, this, 'width'))
.on('changed:after', _.bind(this.changeWidthHeight, this, 'width')) .on('changed:after', _.bind(this.changeWidthHeight, this, 'width'))
.on('changed:before', _.bind(this.onChangeComboScale, this, 'width')); .on('changed:before', _.bind(this.onChangeComboScale, this, 'width'));
@ -138,7 +139,8 @@ define([
menuStyle : 'min-width: 90px;', menuStyle : 'min-width: 90px;',
editable: true, editable: true,
data: this.arrDataScale, data: this.arrDataScale,
scrollAlwaysVisible: true scrollAlwaysVisible: true,
takeFocusOnClose: true
}).on('selected', _.bind(this.changeWidthHeight, this, 'height')) }).on('selected', _.bind(this.changeWidthHeight, this, 'height'))
.on('changed:after', _.bind(this.changeWidthHeight, this, 'height')) .on('changed:after', _.bind(this.changeWidthHeight, this, 'height'))
.on('changed:before', _.bind(this.onChangeComboScale, this, 'height')); .on('changed:before', _.bind(this.onChangeComboScale, this, 'height'));
@ -165,6 +167,14 @@ define([
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [this.cmbScaleWidth, this.cmbScaleHeight, this.spnScale];
},
getDefaultFocusableComponent: function () {
return this.radioScaleTo.getValue() ? this.spnScale : this.cmbScaleWidth;
},
afterRender: function() { afterRender: function() {
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
}, },

View file

@ -306,7 +306,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrCapType data: this._arrCapType,
takeFocusOnClose: true
}); });
this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat); this.cmbCapType.setValue(Asc.c_oAscLineCapType.Flat);
this.cmbCapType.on('selected', _.bind(function(combo, record){ this.cmbCapType.on('selected', _.bind(function(combo, record){
@ -330,7 +331,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100px;', menuStyle: 'min-width: 100px;',
editable: false, editable: false,
data: this._arrJoinType data: this._arrJoinType,
takeFocusOnClose: true
}); });
this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round); this.cmbJoinType.setValue(Asc.c_oAscLineJoinType.Round);
this.cmbJoinType.on('selected', _.bind(function(combo, record){ this.cmbJoinType.on('selected', _.bind(function(combo, record){
@ -484,10 +486,6 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
this.mnuEndSizePicker.on('item:click', _.bind(this.onSelectEndSize, this)); this.mnuEndSizePicker.on('item:click', _.bind(this.onSelectEndSize, this));
this._selectStyleItem(this.btnEndSize, null); this._selectStyleItem(this.btnEndSize, null);
this.on('show', function(obj) {
obj.getChild('.footer .primary').focus();
});
// Columns // Columns
this.spnColumns = new Common.UI.MetricSpinner({ this.spnColumns = new Common.UI.MetricSpinner({
@ -575,6 +573,45 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.spnWidth, this.spnHeight, // 0 tab
this.spnAngle, // 1 tab
this.cmbCapType, this.cmbJoinType, // 2 tab
this.spnMarginTop, this.spnMarginLeft, this.spnMarginBottom, this.spnMarginRight, // 3 tab
this.spnColumns, this.spnSpacing, // 4 tab
this.inputAltTitle, this.textareaAltDescription // 6 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.cmbCapType.focus();
break;
case 3:
me.spnMarginTop.focus();
break;
case 4:
me.spnColumns.focus();
break;
case 6:
me.inputAltTitle.focus();
break;
}
}, 10);
},
afterRender: function() { afterRender: function() {
this.updateMetricUnit(); this.updateMetricUnit();
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);

View file

@ -99,6 +99,7 @@ define([
'item:select': this.onCellCheck.bind(this) 'item:select': this.onCellCheck.bind(this)
}); });
this.columnsList.onKeyDown = _.bind(this.onListKeyDown, this); this.columnsList.onKeyDown = _.bind(this.onListKeyDown, this);
this.columnsList.on('entervalue', _.bind(this.onPrimary, this));
this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.afterRender(); this.afterRender();
@ -153,7 +154,7 @@ define([
this.updateCellCheck(listView, record); this.updateCellCheck(listView, record);
_.delay(function () { _.delay(function () {
listView.$el.find('.listview').focus(); listView.focus();
}, 100, this); }, 100, this);
} }
} }
@ -191,6 +192,11 @@ define([
if (props) { if (props) {
this.updateColumnsList(props); this.updateColumnsList(props);
} }
var me = this;
_.delay(function () {
me.columnsList.focus();
}, 100, this);
}, },
getSettings: function () { getSettings: function () {

View file

@ -384,6 +384,33 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettingsAdvanced.tem
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() {
return [
this.inputHeader, this.numWidth, this.numHeight, this.numCols, this.numColHeight, // 0 tab
this.inputName, // 2 tab
this.inputAltTitle, this.textareaAltDescription // 4 tab
];
},
onCategoryClick: function(btn, index) {
Common.Views.AdvancedSettingsWindow.prototype.onCategoryClick.call(this, btn, index);
var me = this;
setTimeout(function(){
switch (index) {
case 0:
me.inputHeader.focus();
break;
case 2:
me.inputName.focus();
break;
case 4:
me.inputAltTitle.focus();
break;
}
}, 10);
},
getSettings: function() { getSettings: function() {
if (this.isCaptionChanged) if (this.isCaptionChanged)
this._changedProps.asc_setCaption(this.inputHeader.getValue()); this._changedProps.asc_setCaption(this.inputHeader.getValue());

View file

@ -1018,7 +1018,7 @@ define([
Common.UI.Window.prototype.show.apply(this, arguments); Common.UI.Window.prototype.show.apply(this, arguments);
_.delay(function(me){ _.delay(function(me){
me.listNames.$el.find('.listview').focus(); me.listNames.focus();
}, 100, this); }, 100, this);
}, },
@ -1049,7 +1049,7 @@ define([
onUpdateFocus: function () { onUpdateFocus: function () {
_.delay(function(me){ _.delay(function(me){
me.listNames.$el.find('.listview').focus(); me.listNames.focus();
}, 100, this); }, 100, this);
}, },

View file

@ -96,6 +96,23 @@ define([ 'text!spreadsheeteditor/main/app/template/TableSettingsAdvanced.temp
this.afterRender(); this.afterRender();
}, },
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);
},
afterRender: function() { afterRender: function() {
this._setDefaults(this._originalProps); this._setDefaults(this._originalProps);
if (this.storageName) { if (this.storageName) {

View file

@ -129,6 +129,7 @@ define([
menuStyle: 'min-width: 264px;max-height:160px;', menuStyle: 'min-width: 264px;max-height:160px;',
scrollAlwaysVisible: true, scrollAlwaysVisible: true,
editable: false, editable: false,
takeFocusOnClose: true,
data: [ data: [
{ value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum }, { value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum },
{ value: Asc.c_oAscDataConsolidateFunction.Count, displayValue: this.txtCount }, { value: Asc.c_oAscDataConsolidateFunction.Count, displayValue: this.txtCount },
@ -193,12 +194,16 @@ define([
this.afterRender(); this.afterRender();
}, },
afterRender: function() { getFocusedComponents: function() {
this._setDefaults(this.props); return [this.inputCustomName, this.cmbSummarize];
}, },
show: function() { getDefaultFocusableComponent: function () {
Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments); return this.inputCustomName;
},
afterRender: function() {
this._setDefaults(this.props);
}, },
_setDefaults: function (props) { _setDefaults: function (props) {