Fix focus for list settings

This commit is contained in:
Julia Radzhabova 2022-11-25 01:51:48 +03:00
parent b51c911a21
commit 4c9a2fc794
2 changed files with 30 additions and 2 deletions

View file

@ -260,7 +260,9 @@ define([
if (record.value === _BulletTypes.newSymbol) { if (record.value === _BulletTypes.newSymbol) {
var me = this, var me = this,
props = me.bulletProps, props = me.bulletProps,
btn,
handler = function(dlg, result, settings) { handler = function(dlg, result, settings) {
btn = result;
if (result == 'ok') { if (result == 'ok') {
props.changed = true; props.changed = true;
props.code = settings.code; props.code = settings.code;
@ -292,6 +294,9 @@ define([
font: props.font, font: props.font,
symbol: props.symbol, symbol: props.symbol,
handler: handler handler: handler
}).on('close', function(obj){
(btn===undefined) && handler && handler.call(me);
setTimeout(function(){me.cmbBulletFormat.focus();}, 1);
}); });
win.show(); win.show();
win.on('symbol:dblclick', handler); win.on('symbol:dblclick', handler);

View file

@ -297,10 +297,11 @@ define([
this.btnColor = new Common.UI.ButtonColored({ this.btnColor = new Common.UI.ButtonColored({
parentEl: $window.find('#id-dlg-bullet-color'), parentEl: $window.find('#id-dlg-bullet-color'),
cls : 'btn-toolbar', cls : 'btn-toolbar move-focus',
iconCls : 'toolbar__icon btn-fontcolor', iconCls : 'toolbar__icon btn-fontcolor',
hint : this.txtColor, hint : this.txtColor,
menu: true, menu: true,
takeFocusOnClose: true,
additionalItems: [{ additionalItems: [{
id: 'id-dlg-bullet-text-color', id: 'id-dlg-bullet-text-color',
caption: this.txtLikeText, caption: this.txtLikeText,
@ -701,11 +702,23 @@ define([
this.btnMore.on('click', _.bind(this.onMoreClick, this)); this.btnMore.on('click', _.bind(this.onMoreClick, this));
this.on('animate:after', _.bind(this.onAnimateAfter, this)); this.on('animate:after', _.bind(this.onAnimateAfter, this));
if (Common.localStorage.getBool("de-hide-multilevel-settings", true))
this.onMoreClick(this.btnMore);
this.afterRender(); this.afterRender();
}, },
getFocusedComponents: function() { getFocusedComponents: function() {
return [this.cmbFormat, this.cmbAlign, this.cmbSize, this.btnColor, this.levelsList]; switch (this.type) {
case 0:
return [this.cmbFormat, this.cmbAlign, this.cmbSize, this.btnBold, this.btnItalic, this.btnColor];
case 1:
return [this.cmbFormat, this.cmbAlign, this.txtNumFormat, this.cmbFonts, this.btnBold, this.btnItalic, this.btnColor, this.cmbSize];
case 2:
return [this.cmbFormat, this.cmbSize, this.btnBold, this.btnItalic, this.btnColor, this.txtNumFormat, this.btnMore, this.levelsList,
this.cmbFonts, this.cmbLevel, this.spnStart, this.chRestart, this.cmbAlign, this.spnAlign, this.spnIndents, this.cmbFollow, this.chTabStop, this.spnTabStop];
}
return [];
}, },
getDefaultFocusableComponent: function () { getDefaultFocusableComponent: function () {
@ -793,7 +806,9 @@ define([
addNewBullet: function(callback) { addNewBullet: function(callback) {
var me = this, var me = this,
props = me.bulletProps, props = me.bulletProps,
btn,
handler = function(dlg, result, settings) { handler = function(dlg, result, settings) {
btn = result;
if (result == 'ok') { if (result == 'ok') {
props.changed = true; props.changed = true;
props.code = settings.code; props.code = settings.code;
@ -820,6 +835,9 @@ define([
font: props.font, font: props.font,
symbol: props.symbol, symbol: props.symbol,
handler: handler handler: handler
}).on('close', function(obj){
(btn===undefined) && callback && callback.call(me);
setTimeout(function(){me.cmbFormat.focus();}, 1);
}); });
win.show(); win.show();
win.on('symbol:dblclick', handler); win.on('symbol:dblclick', handler);
@ -827,7 +845,9 @@ define([
addNewListType: function(callback) { addNewListType: function(callback) {
var me = this, var me = this,
btn,
handler = function(result, value) { handler = function(result, value) {
btn = result;
if (result == 'ok') { if (result == 'ok') {
if (me._changedProps) { if (me._changedProps) {
me._changedProps.put_Format(value); me._changedProps.put_Format(value);
@ -842,6 +862,9 @@ define([
modal: true, modal: true,
lang: me.lang, lang: me.lang,
handler: handler handler: handler
}).on('close', function(obj){
(btn===undefined) && callback && callback.call(me);
setTimeout(function(){me.cmbFormat.focus();}, 1);
}); });
win.show(); win.show();
}, },