From 1e7bb1667caa8abe4538d574c3f4c2d320100086 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 23 Nov 2022 20:41:39 +0300 Subject: [PATCH] [DE] Change list settings dialog --- apps/common/main/resources/less/buttons.less | 45 ++++ .../main/app/view/ListSettingsDialog.js | 241 ++++++++++++------ .../resources/less/advanced-settings.less | 2 - 3 files changed, 206 insertions(+), 82 deletions(-) diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 350f1130c..13d0e4ed5 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -174,6 +174,51 @@ transform: rotate(225deg); } } + + &.caret-double-right, &.caret-double-left { + &::before, &::after { + content: ''; + position: absolute; + top: 7px; + width: 6px; + height: 6px; + background-color: transparent; + border: solid 1px @text-normal-ie; + border: solid 1px @text-normal; + border-bottom: none; + border-right: none; + } + } + &.caret-double-right { + &::before { + left: 3px; + } + &::after { + left: 9px; + } + &::before, &::after { + -moz-transform: rotate(135deg); + -ms-transform: rotate(135deg); + -webkit-transform: rotate(135deg); + -o-transform: rotate(135deg); + transform: rotate(135deg); + } + } + &.caret-double-left { + &::before { + left: 5px; + } + &::after { + left: 11px; + } + &::before, &::after { + -moz-transform: rotate(315deg); + -ms-transform: rotate(315deg); + -webkit-transform: rotate(315deg); + -o-transform: rotate(315deg); + transform: rotate(315deg); + } + } } &:not(:disabled) { diff --git a/apps/documenteditor/main/app/view/ListSettingsDialog.js b/apps/documenteditor/main/app/view/ListSettingsDialog.js index c35de1a5a..5fad50a67 100644 --- a/apps/documenteditor/main/app/view/ListSettingsDialog.js +++ b/apps/documenteditor/main/app/view/ListSettingsDialog.js @@ -61,90 +61,60 @@ define([ style: 'min-width: 240px;', cls: 'modal-dlg', split: false, - buttons: ['ok', 'cancel'] + buttons: null }, initialize : function(options) { this.type = options.type || 0; - + this.extended = true; + this.rightPanelWidth = 210; _.extend(this.options, { title: this.txtTitle, - height: (this.type==2) ? 520 : 424, - width: (this.type==2) ? 460 : 300 + height: (this.type===2) ? 451 : (this.type===1 ? 470 : 424), + width: (this.type===2) ? 415 + (this.extended ? this.rightPanelWidth : 0) : 300 }, options || {}); this.template = [ + '', + '', + '', + '<% if (type == 2) { %>', + '', + '<% } %>', + '', + '
', '
', '<% if (type == 2) { %>', - '', + '
', '', - '', - '', - '', - '', - '', - '
', + '', '', - '
', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '', - '', - '', - '', - '', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '', - '', - '', - '', - '', - '', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '
', - '
', - '', - '', - '', '', + '', + '', + '', + '', + '', + '
', - '', - '
', - '
', - '
', - '
', + '
', '
', '', '
', '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '', + '', + '', '', '
', + '', + '
', + '
', + '', + '
', + '
', '<% } else if (type == 0) {%>', // bullets @@ -206,17 +176,96 @@ define([ '<% } %>', '', '', - '', + '', + '', + '', '', '', '
', + '', + '
', - '', - '
', + '
', '
', - '
' + '', + '', + '
', + '
', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '', + '
', + '', + '
', + '
', + '', + '
', + '
', + '', + '
', + '
', + '
', + '
', + '', + '', + '', + '
', + '
', + '
', + '
', + '
', + '', + '
', + '
', + '', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
' ].join(''); this.props = options.props; @@ -322,7 +371,7 @@ define([ this.cmbFormat = new Common.UI.ComboBoxCustom({ el : $window.find('#id-dlg-numbering-format'), menuStyle : 'min-width: 100%;max-height: 220px;', - style : this.type===2 ? "width: 107px;" : "width: 129px;", + style : this.type===2 ? "width: 100%;" : "width: 129px;", editable : false, template : _.template(template.join('')), itemsTemplate: _.template(itemsTemplate.join('')), @@ -475,7 +524,7 @@ define([ this.cmbLevel = new Common.UI.ComboBox({ el : $window.find('#id-dlg-numbering-format-lvl'), menuStyle : 'min-width: 100%;', - style : "width: 130px;", + style : "width: 100%;", editable : false, cls : 'input-group-nr', data : [], @@ -486,7 +535,7 @@ define([ this.spnStart = new Common.UI.MetricSpinner({ el: $window.find('#id-dlg-numbering-spin-start'), step: 1, - width: 85, + width: '100%', defaultUnit : "", value: 1, maxValue: 16383, @@ -536,7 +585,7 @@ define([ this.spnAlign = new Common.UI.MetricSpinner({ el: $window.findById('#id-dlg-numbering-align-at'), step: .1, - width: 85, + width: '100%', defaultUnit : "cm", defaultValue : 0, value: '0 cm', @@ -558,7 +607,7 @@ define([ this.spnIndents = new Common.UI.MetricSpinner({ el: $window.findById('#id-dlg-numbering-indent'), step: .1, - width: 85, + width: '100%', defaultUnit : "cm", defaultValue : 0, value: '0 cm', @@ -624,7 +673,7 @@ define([ this.spnTabStop = new Common.UI.MetricSpinner({ el: $window.findById('#id-dlg-num-tabstop'), step: .1, - width: 85, + width: '100%', defaultUnit : "cm", defaultValue : 0, value: '0 cm', @@ -641,6 +690,15 @@ define([ } }, this)); + this.panelMore = $window.findById('#id-dlg-panel-more-settings'); + this.panelMoreTable = this.panelMore.parent(); + this.btnMore = new Common.UI.Button({ + parentEl: $window.findById('#id-dlg-btn-more'), + cls: 'btn-toolbar bg-white', + iconCls: this.extended ? 'caret-double-left' : 'caret-double-right', + hint: this.extended ? this.textHide : this.textMore + }); + this.btnMore.on('click', _.bind(this.onMoreClick, this)); this.on('animate:after', _.bind(this.onAnimateAfter, this)); this.afterRender(); @@ -1250,6 +1308,26 @@ define([ this.saveRecentNum(); }, + onMoreClick: function(btn) { + if (!this.extended) { + this.extended = true; + this.panelMore.css({'display': 'block'}); + this.panelMoreTable.width(this.panelMore.width()); + this.setWidth(this.getWidth() + this.rightPanelWidth); + btn.updateHint(this.textHide); + btn.setIconCls('icon caret-double-left'); + Common.localStorage.setItem("de-hide-multilevel-settings", 0); + } else { + this.extended = false; + this.panelMore.css({'display': 'none'}); + this.panelMoreTable.css({'width': 'auto'}); + this.setWidth(this.getWidth() - this.rightPanelWidth); + btn.updateHint(this.textMore); + btn.setIconCls('icon caret-double-right'); + Common.localStorage.setItem("de-hide-multilevel-settings", 1); + } + }, + txtTitle: 'List Settings', txtSize: 'Size', txtColor: 'Color', @@ -1274,12 +1352,15 @@ define([ textItalic: 'Italic', textTab: 'Tab character', textSpace: 'Space', - txtAlignAt: 'Align at', + txtAlignAt: 'at', txtIndent: 'Text Indent', txtFollow: 'Follow number with', txtRestart: 'Restart list', txtMoreTypes: 'More types', - txtTabStop: 'Add tab stop at' + txtTabStop: 'Add tab stop at', + textMore: 'Show more settings', + textHide: 'Hide settings', + textSelectLevel: 'Select level' }, DE.Views.ListSettingsDialog || {})) }); \ No newline at end of file diff --git a/apps/documenteditor/main/resources/less/advanced-settings.less b/apps/documenteditor/main/resources/less/advanced-settings.less index 84d9d48f1..20813fed0 100644 --- a/apps/documenteditor/main/resources/less/advanced-settings.less +++ b/apps/documenteditor/main/resources/less/advanced-settings.less @@ -40,8 +40,6 @@ } #bulleted-list-preview { - margin-top: 2px; - height:208px; width: 100%; border: @scaled-one-px-value-ie solid @border-regular-control-ie; border: @scaled-one-px-value solid @border-regular-control;