diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index 1045f2316..da5b9b674 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -137,7 +137,7 @@ define([ })).show(); }, - onAnimationAdditional: function() { + onAnimationAdditional: function(replace) { // replace or add new additional effect (new PE.Views.AnimationDialog({ api : this.api, activeEffect : this._state.Effect diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index f1b95bf40..067d5d01e 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -62,10 +62,12 @@ define([ me.fireEvent('animation:selecteffect', [combo, record]); }, me)); me.listEffectsMore.on('click', _.bind(function () { - me.fireEvent('animation:additional'); + me.fireEvent('animation:additional', [true]); // replace effect }, me)); } - + me.btnAddAnimation && me.btnAddAnimation.menu.on('item:click', function (menu, item, e) { + (item.value=='more') && me.fireEvent('animation:additional', [false]); // add effect + }); if (me.btnPreview) { me.btnPreview.on('click', _.bind(function(btn) { me.fireEvent('animation:preview', [me.btnPreview]); @@ -333,12 +335,15 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function() { - setEvents.call(me); - me.btnAddAnimation.setMenu( new Common.UI.Menu({ style: 'width: 370px;padding-top: 12px;', items: [ - {template: _.template('')} + {template: _.template('')}, + {caption: '--'}, + { + caption: me.textMoreEffects, + value: 'more' + } ] })); @@ -348,8 +353,11 @@ define([ var picker = new Common.UI.DataView({ el: $('#id-toolbar-menu-addanimation'), parentMenu: menu, + outerMenu: {menu: me.btnAddAnimation.menu, index: 0}, showLast: false, - restoreHeight: 465, + restoreHeight: 300, + style: 'max-height: 300px;', + scrollAlwaysVisible: true, groups: new Common.UI.DataViewGroupStore(Common.define.effectData.getEffectGroupData()), store: new Common.UI.DataViewStore(Common.define.effectData.getEffectData()), itemTemplate: _.template([ @@ -364,8 +372,11 @@ define([ me.fireEvent('animation:addanimation', [picker, record]); }); menu.off('show:before', onShowBefore); + me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); }; me.btnAddAnimation.menu.on('show:before', onShowBefore); + + setEvents.call(me); }); },