From d207cab6267c383339ee06f1168bb2fc0715358f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 17 Dec 2019 13:15:51 +0300 Subject: [PATCH] [DE] Fix selection for multilevel list --- apps/documenteditor/main/app/controller/Toolbar.js | 12 ++++++++++-- apps/documenteditor/main/app/view/Toolbar.js | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index eb5a1f826..4b2e62878 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -493,7 +493,11 @@ define([ switch(this._state.bullets.type) { case 0: this.toolbar.btnMarkers.toggle(true, true); - this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype, true); + if (this._state.bullets.subtype!==undefined) + this.toolbar.mnuMarkersPicker.selectByIndex(this._state.bullets.subtype, true); + else + this.toolbar.mnuMarkersPicker.deselectAll(true); + this.toolbar.mnuMultilevelPicker.deselectAll(true); break; case 1: var idx = 0; @@ -521,7 +525,11 @@ define([ break; } this.toolbar.btnNumbers.toggle(true, true); - this.toolbar.mnuNumbersPicker.selectByIndex(idx, true); + if (this._state.bullets.subtype!==undefined) + this.toolbar.mnuNumbersPicker.selectByIndex(idx, true); + else + this.toolbar.mnuNumbersPicker.deselectAll(true); + this.toolbar.mnuMultilevelPicker.deselectAll(true); break; case 2: this.toolbar.btnMultilevels.toggle(true, true); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 01efb6c28..a6c2c8493 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -422,6 +422,9 @@ define([ conf: {index: 0}, selectByIndex: function (idx) { this.conf.index = idx; + }, + deselectAll: function () { + this.conf.index = -1; } }; this.mnuNumbersPicker = clone(this.mnuMarkersPicker);