Merge pull request #1673 from ONLYOFFICE/fix/pe-animation-lock

[PE] Fix lock animation tab
This commit is contained in:
Julia Radzhabova 2022-04-01 13:22:20 +03:00 committed by GitHub
commit 7c117994b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 19 deletions

View file

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

View file

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

View file

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