[PE] Fix shape menu (bug 43485)

This commit is contained in:
JuliaSvinareva 2021-09-14 19:48:14 +03:00
parent ce84feba05
commit 879de8f902
3 changed files with 9 additions and 6 deletions

View file

@ -1371,8 +1371,8 @@ define([
selected: false selected: false
}; };
me.recentShapes.unshift(model); me.recentShapes.unshift(model);
if (me.recentShapes.length > 12) { if (me.recentShapes.length > 14) {
me.recentShapes.splice(12, 1); me.recentShapes.splice(14, 1);
} }
me.groups.at(0).groupStore.reset(me.recentShapes); me.groups.at(0).groupStore.reset(me.recentShapes);

View file

@ -1687,17 +1687,19 @@ define([
}, },
updateAutoshapeMenu: function (menuShape, collection) { updateAutoshapeMenu: function (menuShape, collection) {
var me = this; var me = this,
index = $(menuShape.el).prop('id').slice(-1);
var menuitem = new Common.UI.MenuItem({ var menuitem = new Common.UI.MenuItem({
template: _.template('<div id="id-toolbar-menu-insertshape" class="menu-insertshape"></div>') template: _.template('<div id="id-toolbar-menu-insertshape-<%= options.index %>" class="menu-insertshape"></div>'),
index: index
}); });
menuShape.addItem(menuitem); menuShape.addItem(menuitem);
var recents = Common.localStorage.getItem('pe-recent-shapes'); var recents = Common.localStorage.getItem('pe-recent-shapes');
var shapePicker = new Common.UI.DataViewShape({ var shapePicker = new Common.UI.DataViewShape({
el: $('#id-toolbar-menu-insertshape'), el: $('#id-toolbar-menu-insertshape-'+index),
itemTemplate: _.template('<div class="item-shape" id="<%= id %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'), itemTemplate: _.template('<div class="item-shape" id="<%= id %>"><svg width="20" height="20" class=\"icon\"><use xlink:href=\"#svg-icon-<%= data.shapeType %>\"></use></svg></div>'),
groups: collection.toJSON(), groups: collection.toJSON(),
parentMenu: menuShape, parentMenu: menuShape,

View file

@ -258,7 +258,7 @@
} }
.menu-shapes { .menu-shapes {
width: 358px; width: 362px;
padding-top: 8px; padding-top: 8px;
.menu-insertshape { .menu-insertshape {
margin: 5px 5px 0 10px; margin: 5px 5px 0 10px;
@ -268,5 +268,6 @@
} }
.dataview .grouped-data .group-items-container .item { .dataview .grouped-data .group-items-container .item {
box-shadow: none; box-shadow: none;
margin: 2px 2px 2px;
} }
} }