diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index 2fa58f41b..c60760144 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -101,8 +101,10 @@ define([ setApi: function (api) { this.api = api; - this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); - this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this)); + this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); + this.api.asc_registerCallback('asc_onCountPages', _.bind(this.onApiCountPages, this)); + this.api.asc_registerCallback('asc_onAnimPreviewStarted', _.bind(this.onAnimPreviewStarted, this)); + this.api.asc_registerCallback('asc_onAnimPreviewFinished', _.bind(this.onAnimPreviewFinished, this)); return this; }, @@ -123,7 +125,23 @@ define([ }, onPreviewClick: function() { - this.api.asc_StartAnimationPreview(); + if (this._state.playPreview) + this.api.asc_StopAnimationPreview(); + else + this.api.asc_StartAnimationPreview(); + + }, + + onAnimPreviewStarted: function () { + + this._state.playPreview = true; + this.view.btnPreview.setIconCls('toolbar__icon transition-zoom'); + + }, + onAnimPreviewFinished: function () + { + this._state.playPreview = false; + this.view.btnPreview.setIconCls('toolbar__icon transition-fade'); }, onParameterClick: function (value) { @@ -252,6 +270,7 @@ define([ setSettings: function () { this._state.noGraphic = this._state.noAnimation = this._state.noAnimationParam = this._state.noTriggerObjects = this._state.noMoveAnimationLater = this._state.noMoveAnimationEarlier = true; + this._state.noAnimationPreview = !this.api.asc_canStartAnimationPreview(); if (this.AnimationProperties) { this._state.noGraphic = false; this._state.noMoveAnimationLater = !this.api.asc_canMoveAnimationLater(); @@ -405,6 +424,8 @@ define([ this.lockToolbar(PE.enumLock.noMoveAnimationLater, this._state.noMoveAnimationLater); if (this._state.noMoveAnimationEarlier != undefined) this.lockToolbar(PE.enumLock.noMoveAnimationEarlier, this._state.noMoveAnimationEarlier); + if (PE.enumLock.noAnimationPreview != undefined) + this.lockToolbar(PE.enumLock.noAnimationPreview, this._state.noAnimationPreview); } diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index 665e09b86..defd411fa 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -212,7 +212,7 @@ define([ caption: this.txtPreview, split: false, iconCls: 'toolbar__icon transition-fade', - lock: [_set.slideDeleted, _set.noSlides, _set.noAnimation], + lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview], dataHint: '1', dataHintDirection: 'left', dataHintOffset: 'medium' diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 0e251b9ce..7bfb6588a 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -91,6 +91,7 @@ define([ noTriggerObjects: 'no-trigger-objects', noMoveAnimationEarlier: 'no-move-animation-earlier', noMoveAnimationLater: 'no-move-animation-later', + noAnimationPreview: 'no-animation-preview' }; PE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend((function(){