[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
};
me.recentShapes.unshift(model);
if (me.recentShapes.length > 12) {
me.recentShapes.splice(12, 1);
if (me.recentShapes.length > 14) {
me.recentShapes.splice(14, 1);
}
me.groups.at(0).groupStore.reset(me.recentShapes);

View file

@ -1687,17 +1687,19 @@ define([
},
updateAutoshapeMenu: function (menuShape, collection) {
var me = this;
var me = this,
index = $(menuShape.el).prop('id').slice(-1);
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);
var recents = Common.localStorage.getItem('pe-recent-shapes');
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>'),
groups: collection.toJSON(),
parentMenu: menuShape,

View file

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