[PE] Fix Bug 41764

This commit is contained in:
Julia Radzhabova 2019-06-04 11:38:44 +03:00
parent 31ad6f2421
commit 21e097427e
2 changed files with 9 additions and 2 deletions

View file

@ -1749,9 +1749,11 @@ define([
var dataViewItems = picker.dataViewItems, var dataViewItems = picker.dataViewItems,
el = $(dataViewItems[0].el), el = $(dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')), itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
columnCount = Math.floor(picker.cmpEl.width() / itemW), columnCount = Math.floor(picker.options.restoreWidth / itemW + 0.5) || 1, // try to use restore width
col = 0, maxHeight = 0; col = 0, maxHeight = 0;
picker.cmpEl.width(itemW * columnCount + 11);
for (var i=0; i<dataViewItems.length; i++) { for (var i=0; i<dataViewItems.length; i++) {
var div = $(dataViewItems[i].el).find('.title'), var div = $(dataViewItems[i].el).find('.title'),
height = div.height(); height = div.height();
@ -1987,6 +1989,7 @@ define([
el : $('#id-docholder-menu-changeslide'), el : $('#id-docholder-menu-changeslide'),
parentMenu : mnuChangeSlide.menu, parentMenu : mnuChangeSlide.menu,
style: 'max-height: 300px;', style: 'max-height: 300px;',
restoreWidth: 302,
store : PE.getCollection('SlideLayouts'), store : PE.getCollection('SlideLayouts'),
itemTemplate: _.template([ itemTemplate: _.template([
'<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">', '<div class="layout" id="<%= id %>" style="width: <%= itemWidth %>px;">',

View file

@ -1266,6 +1266,7 @@ define([
el: $('#id-toolbar-menu-changeslide'), el: $('#id-toolbar-menu-changeslide'),
parentMenu: me.btnChangeSlide.menu, parentMenu: me.btnChangeSlide.menu,
restoreHeight: 300, restoreHeight: 300,
restoreWidth: 302,
style: 'max-height: 300px;', style: 'max-height: 300px;',
store: PE.getCollection('SlideLayouts'), store: PE.getCollection('SlideLayouts'),
itemTemplate: _.template([ itemTemplate: _.template([
@ -1513,9 +1514,11 @@ define([
var dataViewItems = picker.dataViewItems, var dataViewItems = picker.dataViewItems,
el = $(dataViewItems[0].el), el = $(dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')), itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')),
columnCount = Math.floor(picker.cmpEl.width() / itemW), columnCount = Math.floor(picker.options.restoreWidth / itemW + 0.5) || 1, // try to use restore width
col = 0, maxHeight = 0; col = 0, maxHeight = 0;
picker.cmpEl.width(itemW * columnCount + 11);
for (var i = 0; i < dataViewItems.length; i++) { for (var i = 0; i < dataViewItems.length; i++) {
var div = $(dataViewItems[i].el).find('.title'), var div = $(dataViewItems[i].el).find('.title'),
height = div.height(); height = div.height();
@ -1609,6 +1612,7 @@ define([
parentMenu: btn.menu, parentMenu: btn.menu,
showLast: false, showLast: false,
restoreHeight: 300, restoreHeight: 300,
restoreWidth: 302,
style: 'max-height: 300px;', style: 'max-height: 300px;',
store: PE.getCollection('SlideLayouts'), store: PE.getCollection('SlideLayouts'),
itemTemplate: _.template([ itemTemplate: _.template([