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..054b104bb 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', @@ -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/locale/en.json b/apps/presentationeditor/main/locale/en.json index a069edf6d..355bdb240 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1321,6 +1321,7 @@ "PE.Views.Animation.txtParameters": "Parameters", "PE.Views.Animation.txtPreview": "Preview", "PE.Views.Animation.txtSec": "s", + "PE.Views.Animation.textAutoPreview": "AutoPreview", "PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect", "PE.Views.AnimationDialog.textTitle": "More Effects", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings", diff --git a/apps/presentationeditor/main/locale/ru.json b/apps/presentationeditor/main/locale/ru.json index 42f5e198d..29cff409f 100644 --- a/apps/presentationeditor/main/locale/ru.json +++ b/apps/presentationeditor/main/locale/ru.json @@ -1320,6 +1320,7 @@ "PE.Views.Animation.txtAnimationPane": "Область анимации", "PE.Views.Animation.txtParameters": "Параметры", "PE.Views.Animation.txtPreview": "Просмотр", + "PE.Views.Animation.textAutoPreview": "Автопросмотр", "PE.Views.Animation.txtSec": "сек", "PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта", "PE.Views.AnimationDialog.textTitle": "Другие эффекты",