mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-27 16:23:50 +08:00
Fix focus in format rules dialog
This commit is contained in:
@ -460,6 +460,12 @@ define([
|
||||
'</div>'
|
||||
].join('')),
|
||||
|
||||
render : function(parentEl) {
|
||||
Common.UI.ComboBox.prototype.render.call(this, parentEl);
|
||||
this._formControl = this.cmpEl.find('.form-control');
|
||||
return this;
|
||||
},
|
||||
|
||||
itemClicked: function (e) {
|
||||
var el = $(e.currentTarget).parent();
|
||||
|
||||
@ -546,6 +552,10 @@ define([
|
||||
wheelSpeed: 10,
|
||||
alwaysVisibleY: this.scrollAlwaysVisible
|
||||
}, this.options.scroller));
|
||||
},
|
||||
|
||||
focus: function() {
|
||||
this._formControl && this._formControl.focus();
|
||||
}
|
||||
|
||||
}, Common.UI.ComboBoxIcons || {}));
|
||||
|
||||
@ -804,10 +804,14 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
|
||||
menuStyle : 'max-height: 220px;min-width: 100%;',
|
||||
data : arr
|
||||
}).on('selected', function(combo, record) {
|
||||
combo.skipFocus = true;
|
||||
me.fillIconsControls(record.value, record.data.values);
|
||||
_.delay(function(){
|
||||
me.iconsControls[me.iconsControls.length-1].cmbOperator.focus();
|
||||
me.iconsControls[me.iconsProps.iconsLength-1].cmbOperator.focus();
|
||||
},50);
|
||||
}).on('hide:after', function(combo) {
|
||||
!combo.skipFocus && setTimeout(function(){combo.focus();}, 1);
|
||||
combo.skipFocus = false;
|
||||
});
|
||||
Common.UI.FocusManager.add(this, this.cmbIconsPresets);
|
||||
this.cmbIconsPresets.setValue(3);
|
||||
@ -1575,7 +1579,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
|
||||
} else if (category==9) {
|
||||
focused = this.barControls[0].combo;
|
||||
} else if (category==10) {
|
||||
focused = this.iconsControls[this.iconsControls.length-1].cmbOperator;
|
||||
focused = this.iconsControls[this.iconsProps.iconsLength-1].cmbOperator;
|
||||
}
|
||||
|
||||
focused && _.delay(function(){
|
||||
|
||||
Reference in New Issue
Block a user