[PE mobile] Fix Bug 48566, Fix Bug 48567
This commit is contained in:
parent
b25b9c036c
commit
e11756cbde
|
@ -103,9 +103,14 @@ define([
|
||||||
renderLayouts: function() {
|
renderLayouts: function() {
|
||||||
var $layoutContainer = $('.container-add .slide-layout');
|
var $layoutContainer = $('.container-add .slide-layout');
|
||||||
if ($layoutContainer.length > 0 && _layouts.length>0) {
|
if ($layoutContainer.length > 0 && _layouts.length>0) {
|
||||||
var columns = parseInt(($layoutContainer.width()-20) / (_layouts[0].itemWidth+2)), // magic
|
var itemWidth = _layouts[0].itemWidth,
|
||||||
|
columns = parseInt(($layoutContainer.width()-20) / (itemWidth+2)), // magic
|
||||||
row = -1,
|
row = -1,
|
||||||
layouts = [];
|
layouts = [];
|
||||||
|
if (columns<1) {
|
||||||
|
columns = 1;
|
||||||
|
itemWidth = $layoutContainer.width()-20;
|
||||||
|
}
|
||||||
|
|
||||||
_.each(_layouts, function (layout, index) {
|
_.each(_layouts, function (layout, index) {
|
||||||
if (0 == index % columns) {
|
if (0 == index % columns) {
|
||||||
|
@ -120,13 +125,14 @@ define([
|
||||||
'<ul class="row">',
|
'<ul class="row">',
|
||||||
'<% _.each(row, function(item) { %>',
|
'<% _.each(row, function(item) { %>',
|
||||||
'<li data-type="<%= item.idx %>">',
|
'<li data-type="<%= item.idx %>">',
|
||||||
'<img src="<%= item.imageUrl %>" width="<%= item.itemWidth %>" height="<%= item.itemHeight %>">',
|
'<img src="<%= item.imageUrl %>" width="<%= itemWidth %>" height="<%= item.itemHeight %>">',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<% }); %>',
|
'<% }); %>',
|
||||||
'</ul>',
|
'</ul>',
|
||||||
'<% }); %>'
|
'<% }); %>'
|
||||||
].join(''))({
|
].join(''))({
|
||||||
layouts: layouts
|
layouts: layouts,
|
||||||
|
itemWidth: itemWidth
|
||||||
});
|
});
|
||||||
|
|
||||||
$layoutContainer.html(template);
|
$layoutContainer.html(template);
|
||||||
|
|
|
@ -259,10 +259,14 @@ define([
|
||||||
renderLayouts: function() {
|
renderLayouts: function() {
|
||||||
var $layoutContainer = $('.container-edit .slide-layout');
|
var $layoutContainer = $('.container-edit .slide-layout');
|
||||||
if ($layoutContainer.length > 0 && _layouts.length>0) {
|
if ($layoutContainer.length > 0 && _layouts.length>0) {
|
||||||
var columns = parseInt(($layoutContainer.width()-20) / (_layouts[0].itemWidth+2)), // magic
|
var itemWidth = _layouts[0].itemWidth,
|
||||||
|
columns = parseInt(($layoutContainer.width()-20) / (itemWidth+2)), // magic
|
||||||
row = -1,
|
row = -1,
|
||||||
layouts = [];
|
layouts = [];
|
||||||
|
if (columns<1) {
|
||||||
|
columns = 1;
|
||||||
|
itemWidth = $layoutContainer.width()-20;
|
||||||
|
}
|
||||||
_.each(_layouts, function (layout, index) {
|
_.each(_layouts, function (layout, index) {
|
||||||
if (0 == index % columns) {
|
if (0 == index % columns) {
|
||||||
layouts.push([]);
|
layouts.push([]);
|
||||||
|
@ -276,13 +280,14 @@ define([
|
||||||
'<ul class="row">',
|
'<ul class="row">',
|
||||||
'<% _.each(row, function(item) { %>',
|
'<% _.each(row, function(item) { %>',
|
||||||
'<li data-type="<%= item.idx %>">',
|
'<li data-type="<%= item.idx %>">',
|
||||||
'<img src="<%= item.imageUrl %>" width="<%= item.itemWidth %>" height="<%= item.itemHeight %>">',
|
'<img src="<%= item.imageUrl %>" width="<%= itemWidth %>" height="<%= item.itemHeight %>">',
|
||||||
'</li>',
|
'</li>',
|
||||||
'<% }); %>',
|
'<% }); %>',
|
||||||
'</ul>',
|
'</ul>',
|
||||||
'<% }); %>'
|
'<% }); %>'
|
||||||
].join(''))({
|
].join(''))({
|
||||||
layouts: layouts
|
layouts: layouts,
|
||||||
|
itemWidth: itemWidth
|
||||||
});
|
});
|
||||||
|
|
||||||
$layoutContainer.html(template);
|
$layoutContainer.html(template);
|
||||||
|
|
Loading…
Reference in a new issue