diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index 826b7e716..a35f1f67d 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -140,9 +140,9 @@ define([ })).show(); }, - onAddAnimation: function(combo, record) { + onAddAnimation: function(picker, record) { var type = record.get('value'); - var group = Common.define.effectData.getEffectGroupData().findWhere({id: record.group}).value; + var group = _.findWhere(Common.define.effectData.getEffectGroupData(),{id: record.get('group')}).value; this.addNewEffect(type, group); this._state.EffectGroups = group; this._state.Effect = type; diff --git a/apps/presentationeditor/main/app/view/Animation.js b/apps/presentationeditor/main/app/view/Animation.js index c3f73e34d..493727179 100644 --- a/apps/presentationeditor/main/app/view/Animation.js +++ b/apps/presentationeditor/main/app/view/Animation.js @@ -80,11 +80,6 @@ define([ me.fireEvent('animation:animationpane', [me.btnAnimationPane]); }, me)); } - if (me.btnAddAnimation) { - me.btnAddAnimation.on('click', _.bind(function(btn) { - me.fireEvent('animation:addanimation', [me.btnAddAnimation]); - }, me)); - } if (me.numDuration) { me.numDuration.on('change', function(bth) { @@ -217,7 +212,6 @@ define([ this.btnAddAnimation = new Common.UI.Button({ cls: 'btn-toolbar x-huge icon-top', caption: this.txtAddEffect, - split: true, iconCls: 'toolbar__icon icon btn-addslide', menu: true, //lock: [_set.slideDeleted, _set.noSlides, _set.disableOnStart, _set.transitLock], @@ -367,8 +361,39 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function() { - setEvents.call(me); + + me.btnAddAnimation.setMenu( new Common.UI.Menu({ + style: 'width: 403px;padding-top: 12px;', + items: [ + {template: _.template('
')} + ] + })); + + var itemWidth = 87, + itemHeight = 40; + var onShowBefore = function(menu) { + var picker = new Common.UI.DataView({ + el: $('#id-toolbar-menu-addanimation'), + parentMenu: menu, + showLast: false, + restoreHeight: 465, + groups: new Common.UI.DataViewGroupStore(Common.define.effectData.getEffectGroupData()), + store: new Common.UI.DataViewStore(Common.define.effectData.getEffectData()), + itemTemplate: _.template([ + '