[PE] Animation: support several effects with different subtypes

This commit is contained in:
Julia Radzhabova 2022-01-20 13:22:41 +03:00
parent 39b929a779
commit fed5f742e3
3 changed files with 9 additions and 7 deletions

View file

@ -1142,7 +1142,7 @@ define(function(){ 'use strict';
{value: AscFormat.ENTRANCE_WIPE_FROM_BOTTOM, caption: this.textFromBottom},
{value: AscFormat.ENTRANCE_WIPE_FROM_LEFT, caption: this.textFromLeft},
{value: AscFormat.ENTRANCE_WIPE_FROM_RIGHT, caption: this.textFromRight},
{value: AscFormat.ENTRANCE_WIPE_FROM_FROM_TOP, caption: this.textFromTop}
{value: AscFormat.ENTRANCE_WIPE_FROM_TOP, caption: this.textFromTop}
];
case AscFormat.ENTRANCE_ZOOM:
return [

View file

@ -425,8 +425,10 @@ define([
}
this._state.EffectOption = this.AnimationProperties.asc_getSubtype();
if (this._state.EffectOption !== undefined && this._state.EffectOption !== null)
this._state.noAnimationParam = view.setMenuParameters(this._state.Effect, _.findWhere(this.EffectGroups,{value: this._state.EffectGroup}).id, this._state.EffectOption)===undefined;
if (this._state.EffectOption !== null && this._state.Effect !== AscFormat.ANIM_PRESET_MULTIPLE && this._state.Effect !== AscFormat.ANIM_PRESET_NONE) {
var rec = _.findWhere(this.EffectGroups,{value: this._state.EffectGroup});
this._state.noAnimationParam = view.setMenuParameters(this._state.Effect, rec ? rec.id : undefined, this._state.EffectOption)===undefined;
}
value = this.AnimationProperties.asc_getDuration();
this._state.Duration = (value>=0) ? value/1000 : value ; // undefined or <0

View file

@ -515,7 +515,7 @@ define([
return this.lockedControls;
},
setMenuParameters: function (effectId, effectGroup, option)
setMenuParameters: function (effectId, effectGroup, option) // option = undefined - for add new effect or when selected 2 equal effects with different option (subtype)
{
var arrEffectOptions;
var effect = _.findWhere(this.allEffects, {group: effectGroup, value: effectId});
@ -537,14 +537,14 @@ define([
}, this);
}
else {
this.btnParameters.menu.clearAll();
this.btnParameters.menu.items.forEach(function (opt) {
(opt.value == option) && (selectedElement = opt);
});
}
(selectedElement == undefined) && (selectedElement = this.btnParameters.menu.items[0])
selectedElement.setChecked(true);
selectedElement && selectedElement.setChecked(true);
this._effectId = effectId;
return selectedElement.value;
return selectedElement ? selectedElement.value : this.btnParameters.menu.items[0].value;
},