[PE] Fix animation effects list

This commit is contained in:
Julia Radzhabova 2021-12-03 00:41:39 +03:00
parent b217759f82
commit 125ff2bc5f
4 changed files with 71 additions and 55 deletions

View file

@ -1008,15 +1008,15 @@ define(function() {
{
id: 'menu-effect-group-entrance',
value: AscFormat.PRESET_CLASS_ENTR,
displayValue: this.textEntrance
caption: this.textEntrance
},
{
id: 'menu-effect-group-emphasis',
value: AscFormat.PRESET_CLASS_EMPH,
displayValue: this.textEmphasis
caption: this.textEmphasis
},
{id: 'menu-effect-group-exit', value: Asc.PRESET_CLASS_EXIT, displayValue: this.textExit},
{id: 'menu-effect-group-path', value: AscFormat.PRESET_CLASS_PATH, displayValue: this.textPath}
{id: 'menu-effect-group-exit', value: AscFormat.PRESET_CLASS_EXIT, caption: this.textExit},
{id: 'menu-effect-group-path', value: AscFormat.PRESET_CLASS_PATH, caption: this.textPath}
];
},
@ -1293,32 +1293,32 @@ define(function() {
iconCls: 'transition-push',
displayValue: this.textBounce
},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_DOWN, iconCls: 'transition-push', displayValue: this.textDown},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_LEFT, iconCls: 'transition-push', displayValue: this.textLeft},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_RIGHT, iconCls: 'transition-push', displayValue: this.textRight},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_UP, iconCls: 'transition-push', displayValue: this.textUp},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_ARC_DOWN, iconCls: 'transition-push', displayValue: this.textArcDown},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_ARC_LEFT, iconCls: 'transition-push', displayValue: this.textArcLeft},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_ARC_RIGHT, iconCls: 'transition-push', displayValue: this.textArcRight},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_ARC_UP, iconCls: 'transition-push', displayValue: this.textArcUp},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_TURN_DOWN, iconCls: 'transition-push', displayValue: this.textTurnDown},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_TURN_DOWN_RIGHT, iconCls: 'transition-push', displayValue: this.textTurnDownRight},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_TURN_UP, iconCls: 'transition-push', displayValue: this.textTurnUp},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_TURN_UP_RIGHT, iconCls: 'transition-push', displayValue: this.textTurnUpRight},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_CIRCLE, iconCls: 'transition-push', displayValue: this.textCircle},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_DIAMOND, iconCls: 'transition-push', displayValue: this.textDiamond},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_EQUAL_TRIANGLE, iconCls: 'transition-push', displayValue: this.textEqualTriangle},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_HEXAGON, iconCls: 'transition-push', displayValue: this.textHexagon},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_OCTAGON, iconCls: 'transition-push', displayValue: this.textOctagon},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_PARALLELOGRAM, iconCls: 'transition-push', displayValue: this.textParallelogram},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_PENTAGON, iconCls: 'transition-push', displayValue: this.textPentagon},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_RIGHT_TRIANGLE, iconCls: 'transition-push', displayValue: this.textRightTriangle},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_SQUARE, iconCls: 'transition-push', displayValue: this.textSquare},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_TRAPEZOID, iconCls: 'transition-push', displayValue: this.textTrapezoid},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'transition-push', displayValue: this.textHorizontalFigure},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'transition-push', displayValue: this.textVerticalFigure},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'transition-push', displayValue: this.textLoopDeLoop},
{group: 'menu-effect-group-motion', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'transition-push', displayValue: this.textCustomPath},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_DOWN, iconCls: 'transition-push', displayValue: this.textDown},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LEFT, iconCls: 'transition-push', displayValue: this.textLeft},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_RIGHT, iconCls: 'transition-push', displayValue: this.textRight},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_UP, iconCls: 'transition-push', displayValue: this.textUp},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_DOWN, iconCls: 'transition-push', displayValue: this.textArcDown},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_LEFT, iconCls: 'transition-push', displayValue: this.textArcLeft},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_RIGHT, iconCls: 'transition-push', displayValue: this.textArcRight},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_ARC_UP, iconCls: 'transition-push', displayValue: this.textArcUp},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_DOWN, iconCls: 'transition-push', displayValue: this.textTurnDown},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_DOWN_RIGHT, iconCls: 'transition-push', displayValue: this.textTurnDownRight},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_UP, iconCls: 'transition-push', displayValue: this.textTurnUp},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TURN_UP_RIGHT, iconCls: 'transition-push', displayValue: this.textTurnUpRight},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CIRCLE, iconCls: 'transition-push', displayValue: this.textCircle},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_DIAMOND, iconCls: 'transition-push', displayValue: this.textDiamond},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_EQUAL_TRIANGLE, iconCls: 'transition-push', displayValue: this.textEqualTriangle},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HEXAGON, iconCls: 'transition-push', displayValue: this.textHexagon},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_OCTAGON, iconCls: 'transition-push', displayValue: this.textOctagon},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_PARALLELOGRAM, iconCls: 'transition-push', displayValue: this.textParallelogram},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_PENTAGON, iconCls: 'transition-push', displayValue: this.textPentagon},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_RIGHT_TRIANGLE, iconCls: 'transition-push', displayValue: this.textRightTriangle},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_SQUARE, iconCls: 'transition-push', displayValue: this.textSquare},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_TRAPEZOID, iconCls: 'transition-push', displayValue: this.textTrapezoid},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_HORIZONTAL_FIGURE_8_FOUR, iconCls: 'transition-push', displayValue: this.textHorizontalFigure},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_VERTICAL_FIGURE_8, iconCls: 'transition-push', displayValue: this.textVerticalFigure},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_LOOP_DE_LOOP, iconCls: 'transition-push', displayValue: this.textLoopDeLoop},
{group: 'menu-effect-group-path', value: AscFormat.MOTION_CUSTOM_PATH, iconCls: 'transition-push', displayValue: this.textCustomPath}
];
},

View file

@ -125,7 +125,7 @@ define([
if(this.api && this.AnimationProperties) {
this.AnimationProperties.asc_putSubtype(value);
this.api.asc_SetAnimationProperties(this.AnimationProperties);
this.getAnimationProperties();
// this.getAnimationProperties();
console.log(this.AnimationProperties.asc_getSubtype());
}
@ -148,11 +148,11 @@ define([
this._state.Effect = type;
},
addNewEffect: function (type, group) {
addNewEffect: function (type, group, replace) {
if (this._state.Effect == type) return;
var parameter= this.view.setMenuParameters(type, undefined, group == this._state.EffectGroups);
this.api.asc_AddAnimation(this._state.EffectGroups, type, parameter);
this.api.asc_AddAnimation(this._state.EffectGroups, type, parameter!==undefined ? parameter : 0, !!replace);
if (parameter!= undefined)
this.onParameterClick(parameter);
},
@ -176,7 +176,7 @@ define([
onEffectSelect: function (combo, record) {
var type = record.get('value');
var group = _.findWhere(Common.define.effectData.getEffectGroupData(),{id: record.get('group')}).value;
this.addNewEffect(type, group);
this.addNewEffect(type, group, true);
this._state.EffectGroups = group;
this._state.Effect = type;
},
@ -230,7 +230,7 @@ define([
var value;
this._state.EffectGroup = this.AnimationProperties.asc_getClass();
value = this.AnimationProperties.asc_getType();
value = !value ? -10 : value;
value = !value ? AscFormat.ANIM_PRESET_NONE : value;
this._state.EffectOption = this.AnimationProperties.asc_getSubtype();
this.view.setMenuParameters(value,this._state.EffectOption,true);
this._state.Effect = value;
@ -289,7 +289,7 @@ define([
(this._state.StartSelect==undefined)&&(this._state.StartSelect = AscFormat.NODE_TYPE_CLICKEFFECT);
item = me.cmbStart.store.findWhere({value: this._state.StartSelect});
me.cmbStart.selectRecord(item);
me.chRewind.setValue(this._state.Rewind);
me.chRewind.setValue(this._state.Rewind, true);
}
}, PE.Controllers.Animation || {}));

View file

@ -133,13 +133,22 @@ define([
var _set = PE.enumLock;
this.lockedControls = [];
this._arrEffectName = [{group:'none', value: -10, iconCls: 'transition-none', displayValue: this.textNone}];
Array.prototype.push.apply( this._arrEffectName, Common.define.effectData.getEffectData());
this._arrEffectName = [{group:'none', value: AscFormat.ANIM_PRESET_NONE, iconCls: 'transition-none', displayValue: this.textNone}].concat(Common.define.effectData.getEffectData());
this._arrEffectOptions = [];
var itemWidth = 87,
itemHeight = 40;
this.listEffects = new Common.UI.ComboDataView({
cls: 'combo-styles',
itemWidth: 87,
itemHeight: 40,
cls: 'combo-styles animation',
itemWidth: itemWidth,
itemHeight: itemHeight,
itemTemplate: _.template([
'<div class = "btn_item x-huge" id = "<%= id %>" style = "width: ' + itemWidth + 'px;height: ' + itemHeight + 'px;">',
'<div class = "icon toolbar__icon <%= iconCls %>"></div>',
'<div class = "caption"><%= displayValue %></div>',
'</div>'
].join('')),
groups: new Common.UI.DataViewGroupStore([{id: 'none', value: -10, caption: this.textNone}].concat(Common.define.effectData.getEffectGroupData())),
store: new Common.UI.DataViewStore(this._arrEffectName),
enableKeyEvents: true,
//lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock],
dataHint: '1',
@ -168,15 +177,6 @@ define([
}
});
this.lockedControls.push(this.listEffects);
this.listEffects.menuPicker.store.add(this._arrEffectName);
this.listEffects.fieldPicker.itemTemplate = _.template([
'<div class = "btn_item x-huge" id = "<%= id %>" style = "width: ' + (this.listEffects.itemWidth) + 'px;height: ' + (this.listEffects.itemHeight) + 'px;">',
'<div class = "icon toolbar__icon <%= iconCls %>"></div>',
'<div class = "caption"><%= displayValue %></div>',
'</div>'
].join(''));
this.listEffects.menuPicker.itemTemplate = this.listEffects.fieldPicker.itemTemplate;
this.btnPreview = new Common.UI.Button({
cls: 'btn-toolbar', // x-huge icon-top',
@ -450,7 +450,7 @@ define([
var selectedElement;
this.btnParameters.menu.removeAll();
if(this._arrEffectOptions[effect.value]) {
if(this._arrEffectOptions[effect.value] && this._arrEffectOptions[effect.value].length>0) {
var i=0;
this._arrEffectOptions[effect.value].forEach(function (opt, index) {
this.btnParameters.menu.addItem(opt);

View file

@ -34,6 +34,18 @@
}
}
}
.menu-picker-container .dataview {
padding: 10px 0 0;
.group-description {
padding: 3px 0 3px 10px;
font-weight: bold;
}
.group-items-container > div {
margin: 0 -1px -1px 0;
margin: 0 calc(-1px / var(--pixel-ratio-factor, 1)) 0;
}
}
}
label {
@ -58,10 +70,6 @@
}
}
.caption{
line-height: 18px;
font-size: 11px;
}
.btn_item {
color: @text-normal-ie;
color: @text-normal;
@ -76,4 +84,12 @@
margin-top: -2px;
}
.caption{
line-height: 18px;
font-size: 11px;
text-overflow: ellipsis;
overflow: hidden;
width: 100%;
text-align: center;
}
}