[PE] Fix lock animation tab

This commit is contained in:
Julia Radzhabova 2022-04-01 13:10:56 +03:00
parent 8d7da47db2
commit 278467b74a
3 changed files with 25 additions and 19 deletions

View file

@ -347,8 +347,11 @@ define([
onFocusObject: function(selectedObjects) { onFocusObject: function(selectedObjects) {
this.AnimationProperties = null; this.AnimationProperties = null;
for (var i = 0; i<selectedObjects.length; i++) { for (var i = 0; i<selectedObjects.length; i++) {
if (selectedObjects[i].get_ObjectType() == Asc.c_oAscTypeSelectElement.Animation) { var type = selectedObjects[i].get_ObjectType();
if (type == Asc.c_oAscTypeSelectElement.Animation) {
this.AnimationProperties = selectedObjects[i].get_ObjectValue(); this.AnimationProperties = selectedObjects[i].get_ObjectValue();
} else if (type==Asc.c_oAscTypeSelectElement.Slide) {
this._state.timingLock = selectedObjects[i].get_ObjectValue().get_LockTiming();
} }
} }
if (this._state.onactivetab) if (this._state.onactivetab)
@ -548,6 +551,8 @@ define([
this.lockToolbar(PE.enumLock.noAnimationRepeat, this._state.noAnimationRepeat); this.lockToolbar(PE.enumLock.noAnimationRepeat, this._state.noAnimationRepeat);
if (this._state.noAnimationDuration != undefined) if (this._state.noAnimationDuration != undefined)
this.lockToolbar(PE.enumLock.noAnimationDuration, this._state.noAnimationDuration); this.lockToolbar(PE.enumLock.noAnimationDuration, this._state.noAnimationDuration);
if (this._state.timingLock != undefined)
this.lockToolbar(PE.enumLock.timingLock, this._state.timingLock);
} }
}, PE.Controllers.Animation || {})); }, PE.Controllers.Animation || {}));

View file

@ -207,7 +207,7 @@ define([
store: new Common.UI.DataViewStore(this._arrEffectName), store: new Common.UI.DataViewStore(this._arrEffectName),
additionalMenuItems: [{caption: '--'}, this.listEffectsMore], additionalMenuItems: [{caption: '--'}, this.listEffectsMore],
enableKeyEvents: true, enableKeyEvents: true,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: '-16, 0', dataHintOffset: '-16, 0',
@ -241,7 +241,7 @@ define([
caption: this.txtPreview, caption: this.txtPreview,
split: false, split: false,
iconCls: 'toolbar__icon animation-preview-start', iconCls: 'toolbar__icon animation-preview-start',
lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview], lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'small' dataHintOffset: 'small'
@ -253,7 +253,7 @@ define([
caption: this.txtParameters, caption: this.txtParameters,
iconCls: 'toolbar__icon icon animation-parameters', iconCls: 'toolbar__icon icon animation-parameters',
menu: new Common.UI.Menu({items: []}), menu: new Common.UI.Menu({items: []}),
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationParam], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationParam, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'small' dataHintOffset: 'small'
@ -265,7 +265,7 @@ define([
caption: this.txtAnimationPane, caption: this.txtAnimationPane,
split: true, split: true,
iconCls: 'toolbar__icon transition-apply-all', iconCls: 'toolbar__icon transition-apply-all',
lock: [_set.slideDeleted, _set.noSlides], lock: [_set.slideDeleted, _set.noSlides, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'medium' dataHintOffset: 'medium'
@ -277,7 +277,7 @@ define([
caption: this.txtAddEffect, caption: this.txtAddEffect,
iconCls: 'toolbar__icon icon add-animation', iconCls: 'toolbar__icon icon add-animation',
menu: true, menu: true,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'small' dataHintOffset: 'small'
@ -298,7 +298,7 @@ define([
{value: 1, displayValue: this.str1}, {value: 1, displayValue: this.str1},
{value: 0.5, displayValue: this.str0_5} {value: 0.5, displayValue: this.str0_5}
], ],
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'top', dataHintDirection: 'top',
dataHintOffset: 'small' dataHintOffset: 'small'
@ -309,7 +309,7 @@ define([
el: this.$el.find('#animation-duration'), el: this.$el.find('#animation-duration'),
iconCls: 'toolbar__icon animation-duration', iconCls: 'toolbar__icon animation-duration',
caption: this.strDuration, caption: this.strDuration,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration] lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationDuration, _set.timingLock]
}); });
this.lockedControls.push(this.lblDuration); this.lockedControls.push(this.lblDuration);
@ -318,7 +318,7 @@ define([
cls: 'btn-toolbar', cls: 'btn-toolbar',
iconCls: 'toolbar__icon btn-trigger', iconCls: 'toolbar__icon btn-trigger',
caption: this.strTrigger, caption: this.strTrigger,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects, _set.timingLock],
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
items: [ items: [
{ {
@ -351,7 +351,7 @@ define([
defaultUnit: this.txtSec, defaultUnit: this.txtSec,
maxValue: 300, maxValue: 300,
minValue: 0, minValue: 0,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'bottom', dataHintDirection: 'bottom',
dataHintOffset: 'big' dataHintOffset: 'big'
@ -362,7 +362,7 @@ define([
el: this.$el.find('#animation-delay'), el: this.$el.find('#animation-delay'),
iconCls: 'toolbar__icon animation-delay', iconCls: 'toolbar__icon animation-delay',
caption: this.strDelay, caption: this.strDelay,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation] lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock]
}); });
this.lockedControls.push(this.lblDelay); this.lockedControls.push(this.lblDelay);
@ -370,7 +370,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100%;', menuStyle: 'min-width: 100%;',
editable: false, editable: false,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock],
data: [ data: [
{value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick}, {value: AscFormat.NODE_TYPE_CLICKEFFECT, displayValue: this.textStartOnClick},
{value: AscFormat.NODE_TYPE_WITHEFFECT, displayValue: this.textStartWithPrevious}, {value: AscFormat.NODE_TYPE_WITHEFFECT, displayValue: this.textStartWithPrevious},
@ -386,14 +386,14 @@ define([
el: this.$el.find('#animation-label-start'), el: this.$el.find('#animation-label-start'),
iconCls: 'toolbar__icon btn-preview-start', iconCls: 'toolbar__icon btn-preview-start',
caption: this.strStart, caption: this.strStart,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation] lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock]
}); });
this.lockedControls.push(this.lblStart); this.lockedControls.push(this.lblStart);
this.chRewind = new Common.UI.CheckBox({ this.chRewind = new Common.UI.CheckBox({
el: this.$el.find('#animation-checkbox-rewind'), el: this.$el.find('#animation-checkbox-rewind'),
labelText: this.strRewind, labelText: this.strRewind,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'small' dataHintOffset: 'small'
@ -405,7 +405,7 @@ define([
cls: 'input-group-nr', cls: 'input-group-nr',
menuStyle: 'min-width: 100%;', menuStyle: 'min-width: 100%;',
editable: true, editable: true,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationRepeat], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationRepeat, _set.timingLock],
data: [ data: [
{value: 1, displayValue: this.textNoRepeat}, {value: 1, displayValue: this.textNoRepeat},
{value: 2, displayValue: "2"}, {value: 2, displayValue: "2"},
@ -426,7 +426,7 @@ define([
el: this.$el.find('#animation-repeat'), el: this.$el.find('#animation-repeat'),
iconCls: 'toolbar__icon animation-repeat', iconCls: 'toolbar__icon animation-repeat',
caption: this.strRepeat, caption: this.strRepeat,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationRepeat] lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noAnimationRepeat, _set.timingLock]
}); });
this.lockedControls.push(this.lblRepeat); this.lockedControls.push(this.lblRepeat);
@ -436,7 +436,7 @@ define([
iconCls: 'toolbar__icon btn-arrow-up', iconCls: 'toolbar__icon btn-arrow-up',
style: 'min-width: 82px', style: 'min-width: 82px',
caption: this.textMoveEarlier, caption: this.textMoveEarlier,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects, _set.noMoveAnimationEarlier], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects, _set.noMoveAnimationEarlier, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'medium' dataHintOffset: 'medium'
@ -449,7 +449,7 @@ define([
iconCls: 'toolbar__icon btn-arrow-down', iconCls: 'toolbar__icon btn-arrow-down',
style: 'min-width: 82px', style: 'min-width: 82px',
caption: this.textMoveLater, caption: this.textMoveLater,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects, _set.noMoveAnimationLater], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.noTriggerObjects, _set.noMoveAnimationLater, _set.timingLock],
dataHint: '1', dataHint: '1',
dataHintDirection: 'left', dataHintDirection: 'left',
dataHintOffset: 'medium' dataHintOffset: 'medium'

View file

@ -95,7 +95,8 @@ define([
noMoveAnimationLater: 'no-move-animation-later', noMoveAnimationLater: 'no-move-animation-later',
noAnimationPreview: 'no-animation-preview', noAnimationPreview: 'no-animation-preview',
noAnimationRepeat: 'no-animation-repeat', noAnimationRepeat: 'no-animation-repeat',
noAnimationDuration: 'no-animation-duration' noAnimationDuration: 'no-animation-duration',
timingLock: 'timing-lock'
}; };
PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){ PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){