This commit is contained in:
OVSharova 2021-12-20 19:07:49 +03:00
parent e79216b581
commit 20dff7b2fb
5 changed files with 21 additions and 20 deletions

View file

@ -870,8 +870,8 @@ define(function(){ 'use strict';
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TRAPEZOID, iconCls: 'animation-motion_paths-shapes', displayValue: this.textTrapezoid}, {group: 'menu-effect-group-path', value: AscFormat.MOTION_TRAPEZOID, iconCls: 'animation-motion_paths-shapes', displayValue: this.textTrapezoid},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'animation-motion_paths-loops', displayValue: this.textHorizontalFigure}, {group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'animation-motion_paths-loops', displayValue: this.textHorizontalFigure},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'animation-motion_paths-loops', displayValue: this.textVerticalFigure}, {group: 'menu-effect-group-path', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'animation-motion_paths-loops', displayValue: this.textVerticalFigure},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'animation-motion_paths-loops', displayValue: this.textLoopDeLoop}, {group: 'menu-effect-group-path', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'animation-motion_paths-loops', displayValue: this.textLoopDeLoop}//,
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'animation-motion_paths-custom_path', displayValue: this.textCustomPath} //{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'animation-motion_paths-custom_path', displayValue: this.textCustomPath}
]; ];
}, },

View file

@ -156,12 +156,13 @@ define([
onAnimationAdditional: function(replace) { // replace or add new additional effect onAnimationAdditional: function(replace) { // replace or add new additional effect
var me = this; var me = this;
(new PE.Views.AnimationDialog({ (new PE.Views.AnimationDialog({
api : this.api, api : this.api,
activeEffect : this._state.Effect, activeEffect : this._state.Effect,
handler: function(result, value) { groupValue : this._state.EffectGroup,
handler : function(result, value) {
if (result == 'ok') { if (result == 'ok') {
if (me.api) { if (me.api) {
me.addNewEffect(value.activeEffect, value.activeGroupValue, replace); me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace);
} }
} }
} }
@ -170,13 +171,13 @@ define([
onAddAnimation: function(picker, record) { onAddAnimation: function(picker, record) {
var type = record.get('value'); var type = record.get('value');
var group = _.findWhere(Common.define.effectData.getEffectGroupData(), {id: record.get('group')}).value; var group = _.findWhere(this.EffectGroups, {id: record.get('group')}).value;
this.addNewEffect(type, group, false); this.addNewEffect(type, group, record.get('group'), false);
}, },
addNewEffect: function (type, group, replace) { addNewEffect: function (type, group, groupName, replace) {
if (this._state.Effect == type) return; if (this._state.Effect == type) return;
var parameter = this.view.setMenuParameters(type, undefined, group == this._state.EffectGroups); var parameter = this.view.setMenuParameters(type, groupName, undefined);
this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace); this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace);
this._state.EffectGroups = group; this._state.EffectGroups = group;
this._state.Effect = type; this._state.Effect = type;
@ -236,14 +237,13 @@ define([
onEffectSelect: function (combo, record) { onEffectSelect: function (combo, record) {
if (this.api) { if (this.api) {
var type = record.get('value'); var type = record.get('value');
var group = (type != AscFormat.ANIM_PRESET_NONE) ? _.findWhere(Common.define.effectData.getEffectGroupData(), {id: record.get('group')}).value : undefined; var group = (type != AscFormat.ANIM_PRESET_NONE) ? _.findWhere(this.EffectGroups, {id: record.get('group')}).value : undefined;
this.addNewEffect(type, group, this._state.Effect != AscFormat.ANIM_PRESET_NONE); this.addNewEffect(type, group, record.get('group'),this._state.Effect != AscFormat.ANIM_PRESET_NONE);
} }
}, },
onStartSelect: function (combo, record) { onStartSelect: function (combo, record) {
if (this.api) { if (this.api) {
// this._state.StartEffect = record.value;
this.AnimationProperties.asc_putStartType(record.value); this.AnimationProperties.asc_putStartType(record.value);
this.api.asc_SetAnimationProperties(this.AnimationProperties); this.api.asc_SetAnimationProperties(this.AnimationProperties);
} }
@ -341,8 +341,8 @@ define([
} }
this._state.EffectOption = this.AnimationProperties.asc_getSubtype(); this._state.EffectOption = this.AnimationProperties.asc_getSubtype();
if (this._state.EffectOption !== undefined) if (this._state.EffectOption !== undefined && this._state.EffectOption !== null)
this._state.noAnimationParam = view.setMenuParameters(this._state.Effect, this._state.EffectOption)===undefined; this._state.noAnimationParam = view.setMenuParameters(this._state.Effect, _.findWhere(this.EffectGroups,{value: this._state.EffectGroup}).id, this._state.EffectOption)===undefined;
value = this.AnimationProperties.asc_getDuration(); value = this.AnimationProperties.asc_getDuration();
if (Math.abs(this._state.Duration - value) > 0.001 || if (Math.abs(this._state.Duration - value) > 0.001 ||

View file

@ -477,9 +477,9 @@ define([
return this.lockedControls; return this.lockedControls;
}, },
setMenuParameters: function (effectId, option) setMenuParameters: function (effectId, effectGroup, option)
{ {
var effect = _.findWhere(this.allEffects, {value: effectId}); var effect = _.findWhere(this.allEffects, {group: effectGroup, value: effectId});
var arrEffectOptions = Common.define.effectData.getEffectOptionsData(effect.group, effect.value); var arrEffectOptions = Common.define.effectData.getEffectOptionsData(effect.group, effect.value);
if(!arrEffectOptions) { if(!arrEffectOptions) {
this.btnParameters.menu.removeAll(); this.btnParameters.menu.removeAll();

View file

@ -72,9 +72,9 @@ define([
this.EffectGroupData.forEach(function (item) {item.displayValue = item.caption;}); this.EffectGroupData.forEach(function (item) {item.displayValue = item.caption;});
if ((this.options.activeEffect != undefined) && (this.options.activeEffect != AscFormat.ANIM_PRESET_NONE)){ if ((this.options.activeEffect != undefined) && (this.options.activeEffect != AscFormat.ANIM_PRESET_NONE)){
this._state.activeEffect = this.options.activeEffect; this._state.activeEffect = this.options.activeEffect;
var itemEffect = _.findWhere(this.allEffects,{value: this._state.activeEffect}); this._state.activeGroupValue = this.options.groupValue;
this._state.activeGroup = itemEffect.group; this._state.activeGroup = _.findWhere(this.EffectGroupData, {value: this._state.activeGroupValue}).id;
this._state.activeGroupValue = _.findWhere(this.EffectGroupData, {id: this._state.activeGroup}).value; var itemEffect = _.findWhere(this.allEffects,{group: this._state.activeGroup, value: this._state.activeEffect});
this.activeLevel = itemEffect.level; this.activeLevel = itemEffect.level;
} }
Common.UI.Window.prototype.initialize.call(this, this.options); Common.UI.Window.prototype.initialize.call(this, this.options);

View file

@ -2101,6 +2101,7 @@
"PE.Views.Toolbar.textAlignMiddle": "Align text to the middle", "PE.Views.Toolbar.textAlignMiddle": "Align text to the middle",
"PE.Views.Toolbar.textAlignRight": "Align text right", "PE.Views.Toolbar.textAlignRight": "Align text right",
"PE.Views.Toolbar.textAlignTop": "Align text to the top", "PE.Views.Toolbar.textAlignTop": "Align text to the top",
"PE.Views.Toolbar.textTabAnimation": "Animation",
"PE.Views.Toolbar.textArrangeBack": "Send to Background", "PE.Views.Toolbar.textArrangeBack": "Send to Background",
"PE.Views.Toolbar.textArrangeBackward": "Send Backward", "PE.Views.Toolbar.textArrangeBackward": "Send Backward",
"PE.Views.Toolbar.textArrangeForward": "Bring Forward", "PE.Views.Toolbar.textArrangeForward": "Bring Forward",