From 21e097427e8f563070fb745a8c92f9808fe8db2f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 4 Jun 2019 11:38:44 +0300 Subject: [PATCH] [PE] Fix Bug 41764 --- apps/presentationeditor/main/app/view/DocumentHolder.js | 5 ++++- apps/presentationeditor/main/app/view/Toolbar.js | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 5cba80fb6..a2769cc88 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -1749,9 +1749,11 @@ define([ var dataViewItems = picker.dataViewItems, el = $(dataViewItems[0].el), 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; + picker.cmpEl.width(itemW * columnCount + 11); + for (var i=0; i', diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 39becbb96..fd4dd9cdd 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1266,6 +1266,7 @@ define([ el: $('#id-toolbar-menu-changeslide'), parentMenu: me.btnChangeSlide.menu, restoreHeight: 300, + restoreWidth: 302, style: 'max-height: 300px;', store: PE.getCollection('SlideLayouts'), itemTemplate: _.template([ @@ -1513,9 +1514,11 @@ define([ var dataViewItems = picker.dataViewItems, el = $(dataViewItems[0].el), 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; + picker.cmpEl.width(itemW * columnCount + 11); + for (var i = 0; i < dataViewItems.length; i++) { var div = $(dataViewItems[i].el).find('.title'), height = div.height(); @@ -1609,6 +1612,7 @@ define([ parentMenu: btn.menu, showLast: false, restoreHeight: 300, + restoreWidth: 302, style: 'max-height: 300px;', store: PE.getCollection('SlideLayouts'), itemTemplate: _.template([