From 859f2174e6d74a7064fb960e41293bdf7f6e8e1f Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 9 Dec 2021 04:10:01 +0300 Subject: [PATCH] Fix trigger button --- .../main/app/controller/Animation.js | 13 +---- .../main/app/template/Toolbar.template | 1 - .../main/app/view/Animation.js | 56 +++++++++---------- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index 2de8c522c..59d04b1d2 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -190,11 +190,8 @@ define([ onTriggerClick: function (value) { if(this.api) { - if(value==this.view.triggers.ClickSequence) - { - this._state.Trigger = this.view.triggers.ClickSequence; - this._state.TriggerValue = true; - this.AnimationProperties.asc_putTriggerClickSequence(this._state.TriggerValue); + if(value.value == this.view.triggers.ClickSequence) { + this.AnimationProperties.asc_putTriggerClickSequence(true); this.api.asc_SetAnimationProperties(this.AnimationProperties); } } @@ -202,15 +199,11 @@ define([ onTriggerClickOfClick: function (value) { - if(this.api) - { - // this._state.Trigger = this.view.triggers.ClickOf; - // this._state.TriggerValue = value.caption; + if(this.api) { this.AnimationProperties.asc_putTriggerClickSequence(false); this.AnimationProperties.asc_putTriggerObjectClick(value.caption); this.api.asc_SetAnimationProperties(this.AnimationProperties); } - }, onEffectSelect: function (combo, record) { diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index fd3c8069f..8a560c38f 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -215,7 +215,6 @@
-
diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 7a326d985..98c60a48d 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -262,33 +262,32 @@ define([ this.lockedControls.push(this.numDuration); this.cmbTrigger = new Common.UI.Button({ - parentEl: $('#animation-trigger'), - cls: 'btn-text-split-default', - split: true, - width: 82, - lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects], - menu : new Common.UI.Menu({ - style : 'min-width: 150px;', - items: [ - { - caption: this.textOnClickSequence, - checkable: true, - toggleGroup: 'animtrigger', - value: this.triggers.ClickSequence - }, - { - value: this.triggers.ClickOf, - caption: this.textOnClickOf, - menu: new Common.UI.Menu({ - menuAlign: 'tr-br', - items: [] - }) - }] - }), - dataHint: '1', - dataHintDirection: 'bottom', - dataHintOffset: 'big' - }); + parentEl: $('#animation-trigger'), + cls: 'btn-toolbar', + iconCls: 'toolbar__icon btn-contents', + caption: this.strTrigger, + lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects], + menu : new Common.UI.Menu({ + items: [ + { + caption: this.textOnClickSequence, + checkable: true, + toggleGroup: 'animtrigger', + value: this.triggers.ClickSequence + }, + { + value: this.triggers.ClickOf, + caption: this.textOnClickOf, + menu: new Common.UI.Menu({ + menuAlign: 'tr-br', + items: [] + }) + }] + }), + dataHint: '1', + dataHintDirection: 'left', + dataHintOffset: 'medium' + }); this.lockedControls.push(this.cmbTrigger); this.btnClickOf = this.cmbTrigger.menu.items[1]; @@ -350,7 +349,6 @@ define([ this.$el.find('#animation-delay').text(this.strDelay); this.$el.find('#animation-label-start').text(this.strStart); this.$el.find('#animation-repeat').text(this.strRepeat); - this.$el.find('#animation-label-trigger').text(this.strTrigger); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); }, @@ -417,14 +415,12 @@ define([ this.btnAnimationPane && this.btnAnimationPane.render(this.$el.find('#animation-button-pane')); this.btnAddAnimation && this.btnAddAnimation.render(this.$el.find('#animation-button-add-effect')); this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start')); - //this.cmbTrigger && this.cmbTrigger.render(this.$el.find('#animation-trigger')); this.renderComponent('#animation-spin-duration', this.numDuration); this.renderComponent('#animation-spin-delay', this.numDelay); this.renderComponent('#animation-spin-repeat', this.numRepeat); this.$el.find("#animation-duration").innerText = this.strDuration; this.$el.find("#animation-delay").innerText = this.strDelay; this.$el.find("#animation-label-start").innerText = this.strStart; - this.$el.find("#animation-label-trigger").innerText = this.strTrigger; this.$el.find("#animation-repeat").innerText = this.strRepeat; return this.$el; },