pull/279748/MERGE
Karson 2017-04-29 12:41:10 +08:00
parent 1b308df4b5
commit 58e78e0518
1 changed files with 17 additions and 4 deletions

View File

@ -2086,12 +2086,16 @@ define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], f
var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0; var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
var oldheg = heg + titHeight + btnHeight; var oldheg = heg + titHeight + btnHeight;
var maxheg = 600;
if (frame.outerWidth() < 768) {
maxheg = $(window).height() - 28;
}
// 如果有.layer-footer或窗口小于600则重新排 // 如果有.layer-footer或窗口小于600则重新排
if (layerfooter.size() > 0 || oldheg < 600) { if (layerfooter.size() > 0 || oldheg < maxheg) {
var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0; var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0;
footerHeight = 0; footerHeight = 0;
if (oldheg >= 600) { if (oldheg >= maxheg) {
heg = Math.min(600, oldheg) - titHeight - btnHeight - footerHeight; heg = Math.min(maxheg, oldheg) - titHeight - btnHeight - footerHeight;
} }
layero.css({height: heg + titHeight + btnHeight + footerHeight}); layero.css({height: heg + titHeight + btnHeight + footerHeight});
layero.find("iframe").css({height: heg}); layero.find("iframe").css({height: heg});
@ -7206,6 +7210,7 @@ define('table',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment',
paginationNextText: __("Next"), paginationNextText: __("Next"),
paginationLastText: __("Last"), paginationLastText: __("Last"),
mobileResponsive: true, mobileResponsive: true,
cardView: true,
checkOnInit: true, checkOnInit: true,
extend: { extend: {
index_url: '', index_url: '',
@ -7409,9 +7414,17 @@ define('table',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment',
}, },
'click .btn-delone': function (e, value, row, index) { 'click .btn-delone': function (e, value, row, index) {
var that = this; var that = this;
var top = $(that).offset().top - $(window).scrollTop();
var left = $(that).offset().left - $(window).scrollLeft() - 260;
if (top + 154 > $(window).height()) {
top = top - 154;
}
if ($(window).width() < 480) {
top = left = undefined;
}
var index = Backend.api.layer.confirm( var index = Backend.api.layer.confirm(
__('Are you sure you want to delete this item?'), __('Are you sure you want to delete this item?'),
{icon: 3, title: __('Warning'), offset: [$(that).offset().top, $(that).offset().left - 260], shadeClose: true}, {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true},
function () { function () {
var table = $(that).closest('table'); var table = $(that).closest('table');
Table.api.multi("del", row.id, table, that); Table.api.multi("del", row.id, table, that);