[PE] Animation: fix position for "Multiple" item. Remove custom effect from list for multiple effects

This commit is contained in:
Julia Radzhabova 2021-12-18 00:16:39 +03:00
parent 042f171f2f
commit 9b5420e7b1
3 changed files with 16 additions and 6 deletions

View file

@ -447,13 +447,24 @@ define([
} }
} }
var idx = _.indexOf(this.store.models, record);
if (innerEl) { if (innerEl) {
if (opts && opts.at == 0) if (opts && (typeof opts.at==='number') && opts.at >= 0) {
innerEl.prepend(view.render().el); else if (opts.at == 0) {
innerEl.prepend(view.render().el);
} else if (!(this.groups && this.groups.length > 0)) { // for dataview without groups
var innerDivs = innerEl.find('> div');
if (idx > 0)
$(innerDivs.get(idx - 1)).after(view.render().el);
else {
(innerDivs.length > 0) ? $(innerDivs[idx]).before(view.render().el) : innerEl.append(view.render().el);
}
} else
innerEl.append(view.render().el);
} else
innerEl.append(view.render().el); innerEl.append(view.render().el);
(this.dataViewItems.length<1) && innerEl.find('.empty-text').remove(); (this.dataViewItems.length<1) && innerEl.find('.empty-text').remove();
var idx = _.indexOf(this.store.models, record);
this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx)); this.dataViewItems = this.dataViewItems.slice(0, idx).concat(view).concat(this.dataViewItems.slice(idx));
var me = this, var me = this,

View file

@ -306,6 +306,7 @@ define([
view.listEffects.fillComboView(item, true, forceFill); view.listEffects.fillComboView(item, true, forceFill);
view.btnParameters.setIconCls('toolbar__icon icon ' + item.get('iconCls')); view.btnParameters.setIconCls('toolbar__icon icon ' + item.get('iconCls'));
} else { } else {
store.remove(store.findWhere({isCustom: true})); // remove custom effects
if (this._state.Effect==AscFormat.ANIM_PRESET_MULTIPLE) { // add and select "multiple" item if (this._state.Effect==AscFormat.ANIM_PRESET_MULTIPLE) { // add and select "multiple" item
view.listEffects.fillComboView(store.at(0), false, true); view.listEffects.fillComboView(store.at(0), false, true);
fieldStore.remove(fieldStore.at(fieldStore.length-1)); fieldStore.remove(fieldStore.at(fieldStore.length-1));
@ -318,8 +319,6 @@ define([
view.listEffects.menuPicker.deselectAll(); view.listEffects.menuPicker.deselectAll();
} else { // add custom effect to appropriate group } else { // add custom effect to appropriate group
if (group) { if (group) {
store.remove(store.findWhere({isCustom: true})); // remove other custom effects
var items = store.where({group: group.get('id')}); var items = store.where({group: group.get('id')});
var index = (items && items.length>0) ? store.indexOf(items.at(items.length-1)) : store.length-1; var index = (items && items.length>0) ? store.indexOf(items.at(items.length-1)) : store.length-1;
var rec = _.findWhere(Common.define.effectData.getEffectFullData(), {group: group.get('id'), value: this._state.Effect}); var rec = _.findWhere(Common.define.effectData.getEffectFullData(), {group: group.get('id'), value: this._state.Effect});

View file

@ -400,7 +400,7 @@ define([
accept(); accept();
})).then(function() { })).then(function() {
me.btnAddAnimation.setMenu( new Common.UI.Menu({ me.btnAddAnimation.setMenu( new Common.UI.Menu({
style: 'width: 370px;padding-top: 12px;', style: 'width: 375px;padding-top: 12px;',
items: [ items: [
{template: _.template('<div id="id-toolbar-menu-addanimation" class="menu-animation"></div>')}, {template: _.template('<div id="id-toolbar-menu-addanimation" class="menu-animation"></div>')},
{caption: '--'}, {caption: '--'},