From 5a0161b352fb6881fe530fb23c816b2e36d78f54 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 23 Apr 2021 17:59:55 +0300 Subject: [PATCH] [DE] Show current level of list --- apps/documenteditor/main/app/controller/Toolbar.js | 4 ++++ apps/documenteditor/main/app/view/Toolbar.js | 6 +++--- apps/documenteditor/main/resources/less/toolbar.less | 7 ++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 32922483c..11ede557c 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1414,7 +1414,11 @@ define([ onChangeLevelShowAfter: function(type, menu) { var me = this; var listId = me.api.asc_GetCurrentNumberingId(), + level = me.api.asc_GetCurrentNumberingLvl(), props = (listId !== null) ? me.api.asc_GetNumberingPr(listId) : null; + var item = _.find(menu.items, function(item) { return item.options.level == level; }); + menu.clearAll(); + item && item.setChecked(true); if (props) { this.api.SetDrawImagePreviewBulletChangeListLevel(menu.options.previewIds, props); } diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 176df8653..130b772cb 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1699,7 +1699,7 @@ define([ var items = [], ids = []; for (var i=0; i<9; i++) { ids.push('id-toolbar-menu-markers-level-' + i); - items.push({template: levelTemplate, previewId: ids[i], level: i }); + items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true }); } this.btnMarkers.setMenu( new Common.UI.Menu({ @@ -1731,7 +1731,7 @@ define([ items = []; ids = []; for (var i=0; i<9; i++) { ids.push('id-toolbar-menu-numbering-level-' + i); - items.push({template: levelTemplate, previewId: ids[i], level: i }); + items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true }); } this.btnNumbers.setMenu( new Common.UI.Menu({ @@ -1761,7 +1761,7 @@ define([ items = []; ids = []; for (var i=0; i<9; i++) { ids.push('id-toolbar-menu-multilevels-level-' + i); - items.push({template: levelTemplate, previewId: ids[i], level: i }); + items.push({template: levelTemplate, previewId: ids[i], level: i, checkable: true }); } this.btnMultilevels.setMenu( new Common.UI.Menu({ diff --git a/apps/documenteditor/main/resources/less/toolbar.less b/apps/documenteditor/main/resources/less/toolbar.less index c0e2b6dcd..0cc0de25d 100644 --- a/apps/documenteditor/main/resources/less/toolbar.less +++ b/apps/documenteditor/main/resources/less/toolbar.less @@ -218,11 +218,16 @@ background-color: @canvas-content-background; } - a:hover { + a:hover, a:focus, a.checked { background-color: transparent; .menu-list-preview { .box-shadow(0 0 0 2px @border-control-focus-ie); .box-shadow(0 0 0 @scaled-two-px-value @border-control-focus); } } + a.checked { + &:before { + display: none !important; + } + } }