From 68c72207c84d0252bb14b60835d91e5205e376e5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 23 Dec 2021 01:24:44 +0300 Subject: [PATCH] [PE] Resize toolbar and show More button --- apps/common/main/lib/component/Mixtbar.js | 16 +++++++++--- .../main/app/controller/Toolbar.js | 1 + .../main/app/template/Toolbar.template | 25 +++++++++---------- .../main/app/view/Animation.js | 9 ++++--- .../main/app/view/Toolbar.js | 2 ++ .../main/app/view/Transitions.js | 5 ++-- apps/presentationeditor/main/locale/en.json | 1 + .../main/resources/less/animation.less | 23 ----------------- 8 files changed, 37 insertions(+), 45 deletions(-) diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 5cf4ebc4e..57f4aacdf 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -543,7 +543,7 @@ define([ } var last_separator = null, last_group = null, - prevchild = this.$moreBar.children(); + prevchild = this.$moreBar.children().filter("[data-hidden-tb-item!=true]"); if (prevchild.length>0) { prevchild = $(prevchild[0]); if (prevchild.hasClass('separator')) @@ -555,7 +555,10 @@ define([ var need_break = false; for (var i=items.length-1; i>=0; i--) { var item = $(items[i]); - if (item.hasClass('group')) { + if (!item.is(':visible')) { // move invisible items as is and set special attr + item.attr('data-hidden-tb-item', true); + this.$moreBar.prepend(item); + } else if (item.hasClass('group')) { _rightedge = $active.get(0).getBoundingClientRect().right; if (_rightedge <= _maxright) // stop moving items break; @@ -649,7 +652,14 @@ define([ for (var i=0; i0 || !disable && mask.length==0) return; var toolbar = this.toolbar; + toolbar.hideMoreBtns(); toolbar.$el.find('.toolbar').toggleClass('masked', disable); if (toolbar.btnsAddSlide) // toolbar buttons are rendered diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 4744beac4..236b3b537 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -101,7 +101,7 @@ -
+
@@ -119,7 +119,7 @@
-
+
@@ -143,7 +143,7 @@
-
+
@@ -219,8 +219,7 @@
-
- +
@@ -238,28 +237,28 @@
- +
- +
- +
-
+
- +
@@ -267,12 +266,12 @@
-
+
-
+
-
+
diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index e29ae88ee..207d308c8 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -169,6 +169,7 @@ define([ cls: 'combo-transitions combo-animation', itemWidth: itemWidth, itemHeight: itemHeight, + style: 'min-width:200px;', itemTemplate: _.template([ '
', '
', @@ -259,7 +260,7 @@ define([ this.numDuration = new Common.UI.MetricSpinner({ el: this.$el.find('#animation-spin-duration'), step: 1, - width: 52, + width: 55, value: '', defaultUnit: this.txtSec, maxValue: 300, @@ -304,7 +305,7 @@ define([ this.numDelay = new Common.UI.MetricSpinner({ el: this.$el.find('#animation-spin-delay'), step: 1, - width: 52, + width: 55, value: '', defaultUnit: this.txtSec, maxValue: 300, @@ -318,7 +319,7 @@ define([ this.cmbStart = new Common.UI.ComboBox({ cls: 'input-group-nr', - menuStyle: 'width: 150px;', + menuStyle: 'min-width: 100%;', lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation], data: [ {value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick}, @@ -343,7 +344,7 @@ define([ this.numRepeat = new Common.UI.MetricSpinner({ el: this.$el.find('#animation-spin-repeat'), step: 1, - width: 88, + width: 55, value: '', maxValue: 1000, minValue: 0, diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 9ed7be3d9..eec1beac3 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1023,6 +1023,7 @@ define([ itemWidth: 88, enableKeyEvents: true, itemHeight: 40, + style: 'min-width:130px;', lock: [_set.themeLock, _set.lostConnect, _set.noSlides], dataHint: '1', dataHintDirection: 'bottom', @@ -1076,6 +1077,7 @@ define([ itemHeight: 20, menuMaxHeight: 640, menuWidth: 362, + style: 'width: 140px;', enableKeyEvents: true, lock: [PE.enumLock.slideDeleted, PE.enumLock.lostConnect, PE.enumLock.noSlides, PE.enumLock.disableOnStart], dataHint: '1', diff --git a/apps/presentationeditor/main/app/view/Transitions.js b/apps/presentationeditor/main/app/view/Transitions.js index c2d9c3232..22bee8463 100644 --- a/apps/presentationeditor/main/app/view/Transitions.js +++ b/apps/presentationeditor/main/app/view/Transitions.js @@ -142,6 +142,7 @@ define([ cls: 'combo-transitions', itemWidth: itemWidth, itemHeight: itemHeight, + style: 'min-width:110px;', itemTemplate: _.template([ '
', '
', @@ -221,7 +222,7 @@ define([ this.numDuration = new Common.UI.MetricSpinner({ el: this.$el.find('#transit-spin-duration'), step: 1, - width: 50, + width: 55, value: '', defaultUnit: this.txtSec, maxValue: 300, @@ -236,7 +237,7 @@ define([ this.numDelay = new Common.UI.MetricSpinner({ el: this.$el.find('#transit-spin-delay'), step: 1, - width: 60, + width: 55, value: '', defaultUnit: this.txtSec, maxValue: 300, diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 393ce0b3f..b307e28ad 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -239,6 +239,7 @@ "Common.Translation.warnFileLocked": "The file is being edited in another app. You can continue editing and save it as a copy.", "Common.Translation.warnFileLockedBtnEdit": "Create a copy", "Common.Translation.warnFileLockedBtnView": "Open for viewing", + "Common.Translation.textMoreButton": "More", "Common.UI.ButtonColored.textAutoColor": "Automatic", "Common.UI.ButtonColored.textNewColor": "Add New Custom Color", "Common.UI.ComboBorderSize.txtNoBorders": "No borders", diff --git a/apps/presentationeditor/main/resources/less/animation.less b/apps/presentationeditor/main/resources/less/animation.less index 2c4aff4ff..57e81dce9 100644 --- a/apps/presentationeditor/main/resources/less/animation.less +++ b/apps/presentationeditor/main/resources/less/animation.less @@ -1,26 +1,3 @@ -#animation-panel { - label { - margin-right: 10px; - } - -} -.a-table{ - display: table; - width: 100%; -} -.a-tr{ - display: table-row; - height: 20px; - border-top: 2px solid transparent; - &.bottom { - border-top: 4px solid transparent; - } - .a-td - { - display: table-cell; - } -} - .combo-animation { .menu-picker-container .dataview { padding: 10px 0 0 2px;