Merge pull request #529 from ONLYOFFICE/feature/pr-focus-manager
Feature/pr focus manager
This commit is contained in:
commit
1478a3b4aa
|
@ -149,6 +149,11 @@ Common.UI.FocusManager = new(function() {
|
|||
_windows[e.cid].fields = register(e.getFocusedComponents());
|
||||
addTraps(_windows[e.cid]);
|
||||
}
|
||||
|
||||
if (e && e.getDefaultFocusableComponent())
|
||||
setTimeout(function(){
|
||||
e.getDefaultFocusableComponent().focus();
|
||||
}, 100);
|
||||
},
|
||||
'modal:close': function(e, last) {
|
||||
if (e && e.cid && _windows[e.cid]) {
|
||||
|
|
|
@ -984,6 +984,10 @@ define([
|
|||
return [];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function() {
|
||||
return undefined;
|
||||
},
|
||||
|
||||
cancelButtonText: 'Cancel',
|
||||
okButtonText: 'OK',
|
||||
yesButtonText: 'Yes',
|
||||
|
|
|
@ -128,16 +128,16 @@ define([
|
|||
this.getChild().find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||
|
||||
this.updateMetricUnit();
|
||||
|
||||
setTimeout(function(){
|
||||
me.spnColumns.focus();
|
||||
}, 100);
|
||||
},
|
||||
|
||||
getFocusedComponents: function() {
|
||||
return [this.spnColumns, this.spnSpacing];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.spnColumns;
|
||||
},
|
||||
|
||||
_handleInput: function(state) {
|
||||
if (this.options.handler) {
|
||||
this.options.handler.call(this, this, state);
|
||||
|
|
|
@ -341,6 +341,10 @@ define([
|
|||
return [this.cmbFormat, this.cmbAlign, this.cmbSize, {cmp: this.levelsList, selector: '.listview'}];
|
||||
},
|
||||
|
||||
getDefaultFocusableComponent: function () {
|
||||
return this.type > 0 ? this.cmbFormat : this.cmbAlign;
|
||||
},
|
||||
|
||||
afterRender: function() {
|
||||
this.updateThemeColors();
|
||||
this._setDefaults(this.props);
|
||||
|
@ -356,11 +360,6 @@ define([
|
|||
|
||||
show: function() {
|
||||
Common.UI.Window.prototype.show.apply(this, arguments);
|
||||
|
||||
var me = this;
|
||||
_.delay(function(){
|
||||
(me.type>0) ? me.cmbFormat.focus() : me.cmbAlign.focus();
|
||||
},100);
|
||||
},
|
||||
|
||||
updateThemeColors: function() {
|
||||
|
|
Loading…
Reference in a new issue