From 408afd6f7eb2c18204d52857c2b7fbc2afbeb005 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 4 Dec 2019 10:05:29 +0300 Subject: [PATCH] [DE] Add bullet settings --- .../main/app/controller/Toolbar.js | 35 ++++++++++++++++++- apps/documenteditor/main/app/view/Toolbar.js | 10 ++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index eb5a1f826..09b3df7ba 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -58,7 +58,8 @@ define([ 'documenteditor/main/app/view/CustomColumnsDialog', 'documenteditor/main/app/view/ControlSettingsDialog', 'documenteditor/main/app/view/WatermarkSettingsDialog', - 'documenteditor/main/app/view/CompareSettingsDialog' + 'documenteditor/main/app/view/CompareSettingsDialog', + 'documenteditor/main/app/view/BulletSettingsDialog' ], function () { 'use strict'; @@ -285,6 +286,7 @@ define([ toolbar.mnuMarkersPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnMarkers)); toolbar.mnuNumbersPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnNumbers)); toolbar.mnuMultilevelPicker.on('item:click', _.bind(this.onSelectBullets, this, toolbar.btnMultilevels)); + toolbar.mnuMarkerSettings.on('click', _.bind(this.onMarkerSettingsClick, this, 0)); toolbar.btnHighlightColor.on('click', _.bind(this.onBtnHighlightColor, this)); toolbar.btnFontColor.on('click', _.bind(this.onBtnFontColor, this)); toolbar.btnParagraphColor.on('click', _.bind(this.onBtnParagraphColor, this)); @@ -1311,6 +1313,37 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, + onMarkerSettingsClick: function(type) { + var me = this, + props; + + var selectedElements = me.api.getSelectedElements(); + if (selectedElements && _.isArray(selectedElements)) { + for (var i = 0; i< selectedElements.length; i++) { + if (Asc.c_oAscTypeSelectElement.Paragraph == selectedElements[i].get_ObjectType()) { + props = selectedElements[i].get_ObjectValue(); + break; + } + } + } + if (props) { + (new DE.Views.BulletSettingsDialog({ + api: me.api, + props: props, + type: type, + interfaceLang: me.mode.lang, + handler: function(result, value) { + if (result == 'ok') { + if (me.api) { + // me.api.paraApply(value); + } + } + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + })).show(); + } + }, + onLineSpaceToggle: function(menu, item, state, e) { if (!!state) { this._state.linespace = undefined; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 01efb6c28..5d2752735 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1605,7 +1605,12 @@ define([ new Common.UI.Menu({ style: 'min-width: 139px', items: [ - {template: _.template('')} + {template: _.template('')}, + this.mnuMarkerSettings = new Common.UI.MenuItem({ + caption: this.textBulletSettings, + // disabled: (this.mnuMarkersPicker.conf.index || 0)==0, + value: 'settings' + }) ] }) ); @@ -2286,7 +2291,8 @@ define([ capBtnInsSymbol: 'Symbol', tipInsertSymbol: 'Insert symbol', mniDrawTable: 'Draw Table', - mniEraseTable: 'Erase Table' + mniEraseTable: 'Erase Table', + textBulletSettings: 'Define New Bullet' } })(), DE.Views.Toolbar || {})); });