This commit is contained in:
OVSharova 2021-10-24 03:14:52 +03:00
parent 4b1d2b6dc3
commit 205750bb82
3 changed files with 74 additions and 33 deletions

View file

@ -68,7 +68,7 @@ define([
'animation:selecteffect': _.bind(this.onEffectSelect, this), 'animation:selecteffect': _.bind(this.onEffectSelect, this),
'animation:delay': _.bind(this.onDelayChange, this), 'animation:delay': _.bind(this.onDelayChange, this),
'animation:animationpane':_.bind(this.onAnimationPane, this), 'animation:animationpane':_.bind(this.onAnimationPane, this),
'animation:addeffect': _.bind(this.onAddEffect, this), 'animation:addanimation': _.bind(this.onAddAnimation, this),
'animation:startselect': _.bind(this.onStartSelect, this), 'animation:startselect': _.bind(this.onStartSelect, this),
}, },
'Toolbar': { 'Toolbar': {
@ -119,16 +119,15 @@ define([
}, },
onParameterClick: function (item) { onParameterClick: function (value) {
this._state.EffectType = item.value; this._state.EffectType = value;
}, },
onAnimationPane: function() { onAnimationPane: function() {
}, },
onAddEffect: function() { onAddAnimation: function() {
}, },
@ -142,13 +141,16 @@ define([
onEffectSelect: function (combo, record) { onEffectSelect: function (combo, record) {
var type = record.get('value'); var type = record.get('value');
var parameter = this._state.EffectType;
if (this.Effect !== type &&
!((this.Effect === Asc.c_oAscSlideTransitionTypes.Wipe || this.Effect === Asc.c_oAscSlideTransitionTypes.UnCover || this.Effect === Asc.c_oAscSlideTransitionTypes.Cover)&&
(type === Asc.c_oAscSlideTransitionTypes.Wipe || type === Asc.c_oAscSlideTransitionTypes.UnCover || type === Asc.c_oAscSlideTransitionTypes.Cover)))
parameter = this.view.setMenuParameters(type);
this._state.Effect = type;
this.onParameterClick(parameter);
if (this._state.Effect !== type) {
this._state.Effect = type;
var parameter = this.view.setMenuParameters(type);
if (parameter)
this.onParameterClick(parameter);
}
}, },
onStartSelect: function (combo, record) { onStartSelect: function (combo, record) {

View file

@ -184,6 +184,15 @@
<div class="group small"> <div class="group small">
<span class="btn-slot text x-huge" id="animation-button-parameters"></span> <span class="btn-slot text x-huge" id="animation-button-parameters"></span>
</div> </div>
<div class="separator long"></div>
<div class="group small">
<div class="elset">
<span class="btn-slot text " id="animation-button-add-effect"></span>
</div>
<div class="elset">
<span class="btn-slot text" id="animation-button-preview"></span>
</div>
</div>
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small" style = "min-width: 130px;"> <div class="group small" style = "min-width: 130px;">
<div class="elset font-normal"> <div class="elset font-normal">
@ -193,7 +202,6 @@
<div class="elset"> <div class="elset">
<span class="btn-slot text " id="animation-button-pane"></span> <span class="btn-slot text " id="animation-button-pane"></span>
</div> </div>
</div> </div>
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small" style = "min-width: 122px;"> <div class="group small" style = "min-width: 122px;">
@ -206,16 +214,17 @@
<span id="animation-spin-duration" class="btn-slot text spinner" style="float: right"></span> <span id="animation-spin-duration" class="btn-slot text spinner" style="float: right"></span>
</div> </div>
</div> </div>
<div class="separator long"></div> <div class="separator long"></div>
<div class="group small"> <div class="group small" style = "min-width: 122px;">
<div class="elset"> <div class="elset font-normal">
<span class="btn-slot text " id="animation-button-add-effect"></span> <span class="btn-slot text" id="animation-checkbox-rewind"></span>
</div> </div>
<div class="elset"> <div class="elset font-normal">
<span class="btn-slot text" id="animation-button-preview"></span> <label id="animation-repeat"></label>
<span id="animation-spin-repeat" class="btn-slot text spinner" ></span>
</div> </div>
</div> </div>
</section> </section>
</section> </section>
</section> </section>

View file

@ -70,12 +70,8 @@ define([
} }
if (me.btnParameters) { if (me.btnParameters) {
me.btnParameters.on('click', function (e) {
me.fireEvent('animation:parameters', ['current']);
});
me.btnParameters.menu.on('item:click', function (menu, item, e) { me.btnParameters.menu.on('item:click', function (menu, item, e) {
me.fireEvent('animation:parameters', [item]); me.fireEvent('animation:parameters', [item.value]);
}); });
} }
@ -84,9 +80,9 @@ define([
me.fireEvent('animation:animationpane', [me.btnAnimationPane]); me.fireEvent('animation:animationpane', [me.btnAnimationPane]);
}, me)); }, me));
} }
if (me.btnAddEffect) { if (me.btnAddAnimation) {
me.btnAddEffect.on('click', _.bind(function(btn) { me.btnAddAnimation.on('click', _.bind(function(btn) {
me.fireEvent('animation:addeffect', [me.btnAddEffect]); me.fireEvent('animation:addanimation', [me.btnAddAnimation]);
}, me)); }, me));
} }
@ -109,6 +105,12 @@ define([
}) })
} }
if (me.numRepeat) {
me.numRepeat.on('change', function(bth) {
me.fireEvent('animation:repeat', [me.numRepeat]);
}, me);
}
} }
return { return {
@ -218,7 +220,7 @@ define([
}); });
this.lockedControls.push(this.btnAnimationPane); this.lockedControls.push(this.btnAnimationPane);
this.btnAddEffect = new Common.UI.Button({ this.btnAddAnimation = new Common.UI.Button({
cls: 'btn-toolbar', cls: 'btn-toolbar',
caption: this.txtAddEffect, caption: this.txtAddEffect,
split: true, split: true,
@ -228,7 +230,7 @@ define([
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'medium' dataHintOffset: 'medium'
}); });
this.lockedControls.push(this.btnAddEffect); this.lockedControls.push(this.btnAddAnimation);
this.numDuration = new Common.UI.MetricSpinner({ this.numDuration = new Common.UI.MetricSpinner({
el: this.$el.find('#animation-spin-duration'), el: this.$el.find('#animation-spin-duration'),
@ -274,11 +276,35 @@ define([
}); });
this.lockedControls.push(this.cmbStart); this.lockedControls.push(this.cmbStart);
this.chRewind = new Common.UI.CheckBox({
el: this.$el.find('#animation-checkbox-rewind'),
labelText: this.strRewind,
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.lockedControls.push(this.chRewind);
this.numRepeat = new Common.UI.MetricSpinner({
el: this.$el.find('#animation-spin-repeat'),
step: 1,
width: 52,
value: '',
maxValue: 300,
minValue: 0,
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
Common.Utils.lockControls(PE.enumLock.disableOnStart, true, {array: this.lockedControls}); Common.Utils.lockControls(PE.enumLock.disableOnStart, true, {array: this.lockedControls});
this.$el.find('#animation-duration').text(this.strDuration); this.$el.find('#animation-duration').text(this.strDuration);
this.$el.find('#animation-delay').text(this.strDelay); this.$el.find('#animation-delay').text(this.strDelay);
this.$el.find('#animation-label-start').text(this.strStart); this.$el.find('#animation-label-start').text(this.strStart);
this.$el.find('#animation-repeat').text(this.strRepeat);
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this)); Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
}, },
@ -340,13 +366,15 @@ define([
this.btnPreview && this.btnPreview.render(this.$el.find('#animation-button-preview')); this.btnPreview && this.btnPreview.render(this.$el.find('#animation-button-preview'));
this.btnParameters && this.btnParameters.render(this.$el.find('#animation-button-parameters')); this.btnParameters && this.btnParameters.render(this.$el.find('#animation-button-parameters'));
this.btnAnimationPane && this.btnAnimationPane.render(this.$el.find('#animation-button-pane')); this.btnAnimationPane && this.btnAnimationPane.render(this.$el.find('#animation-button-pane'));
this.btnAddEffect && this.btnAddEffect.render(this.$el.find('#animation-button-add-effect')); this.btnAddAnimation && this.btnAddAnimation.render(this.$el.find('#animation-button-add-effect'));
this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start')) this.cmbStart && this.cmbStart.render(this.$el.find('#animation-start'))
this.renderComponent('#animation-spin-duration', this.numDuration); this.renderComponent('#animation-spin-duration', this.numDuration);
this.renderComponent('#animation-spin-delay', this.numDelay); 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-duration").innerText = this.strDuration;
this.$el.find("#animation-delay").innerText = this.strDelay; this.$el.find("#animation-delay").innerText = this.strDelay;
this.$el.find("#animation-label-start").innerText = this.strStart; this.$el.find("#animation-label-start").innerText = this.strStart;
this.$el.find("#animation-repeat").innerText = this.strRepeat;
return this.$el; return this.$el;
}, },
@ -406,9 +434,9 @@ define([
var selectedElement; var selectedElement;
_.each(this.btnParameters.menu.items, function (element, index) { _.each(this.btnParameters.menu.items, function (element, index) {
if (((index < minMax[0])||(index > minMax[1]))) if (((index < minMax[0])||(index > minMax[1])))
element.$el.css('display', 'none'); element.setVisible(false);
else { else {
element.$el.css('display', ''); element.setVisible(true);
if (value != undefined) { if (value != undefined) {
if (value == element.value) selectedElement = element; if (value == element.value) selectedElement = element;
@ -427,7 +455,7 @@ define([
this.btnPreview.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None); this.btnPreview.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None);
this.numDuration.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None); this.numDuration.setDisabled(effect === Asc.c_oAscSlideTransitionTypes.None);
} }
return selectedElement; return (selectedElement)?selectedElement.value:-1;
}, },
@ -435,10 +463,12 @@ define([
txtPreview: 'Preview', txtPreview: 'Preview',
txtParameters: 'Parameters', txtParameters: 'Parameters',
txtAnimationPane: 'Animation Pane', txtAnimationPane: 'Animation Pane',
txtAddEffect: 'Add effect', txtAddEffect: 'Add animation',
strDuration: 'Duration', strDuration: 'Duration',
strDelay: 'Delay', strDelay: 'Delay',
strStart: 'Start', strStart: 'Start',
strRewind: 'Rewind',
strRepeat: 'Repeat',
textStartOnClick: 'On Click', textStartOnClick: 'On Click',
textStartBeforePrevious: 'Before Previous', textStartBeforePrevious: 'Before Previous',