diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index b1edcf2ba..c82c014c2 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -174,7 +174,7 @@ define([ handler : function(result, value) { if (result == 'ok') { if (me.api) { - me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview")); + me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined); } } } @@ -189,7 +189,7 @@ define([ addNewEffect: function (type, group, groupName, replace, parametr, preview) { var parameter = this.view.setMenuParameters(type, groupName, parametr); - this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview); + this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")); }, onDurationChange: function(before,combo, record, e) { diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index e2b4e7386..e2e856c91 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -76,6 +76,12 @@ define([ me.btnPreview.on('click', _.bind(function(btn) { me.fireEvent('animation:preview', [me.btnPreview]); }, me)); + me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) { + if (item.value === 'preview') + me.fireEvent('animation:preview', [me.btnPreview]); + else if (item.value === 'auto') + Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked); + }, me)); } if(me.cmbTrigger) @@ -239,7 +245,8 @@ define([ this.btnPreview = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top', caption: this.txtPreview, - split: false, + split: true, + menu: true, iconCls: 'toolbar__icon animation-preview-start', lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock], dataHint: '1', @@ -349,7 +356,7 @@ define([ width: 55, value: '', defaultUnit: this.txtSec, - maxValue: 300, + maxValue: 60, minValue: 0, lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock], dataHint: '1', @@ -513,6 +520,15 @@ define([ me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); }; me.btnAddAnimation.menu.on('show:before', onShowBefore); + + me.btnPreview.setMenu( new Common.UI.Menu({ + style: "min-width: auto;", + items: [ + {caption: me.txtPreview, value: 'preview'}, + {caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")} + ] + })); + setEvents.call(me); }); }, @@ -625,7 +641,8 @@ define([ str3: '3 s (Slow)', str2: '2 s (Medium)', str1: '1 s (Fast)', - str0_5: '0.5 s (Very Fast)' + str0_5: '0.5 s (Very Fast)', + textAutoPreview: 'AutoPreview' } }()), PE.Views.Animation || {})); diff --git a/apps/presentationeditor/main/app/view/AnimationDialog.js b/apps/presentationeditor/main/app/view/AnimationDialog.js index d8f051f78..852c1b5b6 100644 --- a/apps/presentationeditor/main/app/view/AnimationDialog.js +++ b/apps/presentationeditor/main/app/view/AnimationDialog.js @@ -44,7 +44,7 @@ define([ PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({ options: { width: 350, - height: 426, + height: 396, header: true, cls: 'animation-dlg', buttons: ['ok', 'cancel'] @@ -57,8 +57,8 @@ define([ '