|
|
@@ -2041,7 +2041,7 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
|
|
|
url = Fast.api.fixurl(url);
|
|
|
url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
|
|
|
var area = [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
|
|
|
- Layer.open($.extend({
|
|
|
+ options = $.extend({
|
|
|
type: 2,
|
|
|
title: title,
|
|
|
shadeClose: true,
|
|
|
@@ -2083,7 +2083,12 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
|
|
|
// observer.disconnect();
|
|
|
}
|
|
|
}
|
|
|
- }, options ? options : {}));
|
|
|
+ }, options ? options : {});
|
|
|
+ if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0) {
|
|
|
+ options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
|
|
|
+ options.offset = "lt";
|
|
|
+ }
|
|
|
+ Layer.open(options);
|
|
|
return false;
|
|
|
},
|
|
|
//关闭窗口并回传数据
|
|
|
@@ -2108,33 +2113,25 @@ define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, u
|
|
|
$(">", footer).wrapAll("<div class='row'></div>");
|
|
|
}
|
|
|
footer.insertAfter(layero.find('.layui-layer-content'));
|
|
|
- }
|
|
|
- var heg = frame.outerHeight();
|
|
|
- var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
|
|
|
- var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
|
|
|
-
|
|
|
- var oldheg = heg + titHeight + btnHeight;
|
|
|
- var maxheg = $(window).height() < 600 ? $(window).height() : 600;
|
|
|
- if (frame.outerWidth() < 768 || that.area[0].indexOf("%") > -1) {
|
|
|
- maxheg = $(window).height();
|
|
|
- }
|
|
|
- // 如果有.layer-footer或窗口小于600则重新排
|
|
|
- if (layerfooter.size() > 0 || oldheg < maxheg || that.area[0].indexOf("%") > -1) {
|
|
|
- var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0;
|
|
|
- footerHeight = 0;
|
|
|
- if (oldheg >= maxheg) {
|
|
|
- heg = Math.min(maxheg, oldheg) - titHeight - btnHeight - footerHeight;
|
|
|
- }
|
|
|
- layero.css({height: heg + titHeight + btnHeight + footerHeight});
|
|
|
- layero.find("iframe").css({height: heg});
|
|
|
- }
|
|
|
- if (layerfooter.size() > 0) {
|
|
|
+ //绑定事件
|
|
|
footer.on("click", ".btn", function () {
|
|
|
if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
|
|
|
return;
|
|
|
}
|
|
|
$(".btn:eq(" + $(this).index() + ")", layerfooter).trigger("click");
|
|
|
});
|
|
|
+
|
|
|
+ var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
|
|
|
+ var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
|
|
|
+ //重设iframe高度
|
|
|
+ $("iframe", layero).height(layero.height() - titHeight - btnHeight);
|
|
|
+ }
|
|
|
+ //修复iOS下弹出窗口的高度和iOS下iframe无法滚动的BUG
|
|
|
+ if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
|
|
|
+ var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
|
|
|
+ var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
|
|
|
+ $("iframe", layero).parent().addClass("ios-iframe-fix").css("height", layero.height() - titHeight - btnHeight);
|
|
|
+ $("iframe", layero).css("height", "100%");
|
|
|
}
|
|
|
},
|
|
|
success: function (options, callback) {
|
|
|
@@ -7855,18 +7852,18 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
$(toolbar).on('click', Table.config.refreshbtn, function () {
|
|
|
table.bootstrapTable('refresh');
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
// 添加按钮事件
|
|
|
$(toolbar).on('click', Table.config.addbtn, function () {
|
|
|
var ids = Table.api.selectedids(table);
|
|
|
- Fast.api.open(options.extend.add_url + "/ids" + (ids.length > 0 ? '/' : '') + ids.join(","), __('Add'));
|
|
|
+ Fast.api.open(options.extend.add_url + (ids.length > 0 ? (options.extend.add_url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + ids.join(",") : ''), __('Add'));
|
|
|
});
|
|
|
// 批量编辑按钮事件
|
|
|
$(toolbar).on('click', Table.config.editbtn, function () {
|
|
|
var ids = Table.api.selectedids(table);
|
|
|
//循环弹出多个编辑框
|
|
|
$.each(ids, function (i, j) {
|
|
|
- Fast.api.open(options.extend.edit_url + "/ids/" + j, __('Edit'));
|
|
|
+ Fast.api.open(options.extend.edit_url + (options.extend.edit_url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + j, __('Edit'));
|
|
|
});
|
|
|
});
|
|
|
// 批量操作按钮事件
|
|
|
@@ -7930,7 +7927,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
});
|
|
|
$(table).on("click", "[data-id].btn-edit", function (e) {
|
|
|
e.preventDefault();
|
|
|
- Fast.api.open(options.extend.edit_url + "/ids/" + $(this).data("id"), __('Edit'));
|
|
|
+ Fast.api.open(options.extend.edit_url + (options.extend.edit_url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + $(this).data("id"), __('Edit'));
|
|
|
});
|
|
|
$(table).on("click", "[data-id].btn-del", function (e) {
|
|
|
e.preventDefault();
|
|
|
@@ -7969,7 +7966,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
|
|
|
'click .btn-editone': function (e, value, row, index) {
|
|
|
e.stopPropagation();
|
|
|
var options = $(this).closest('table').bootstrapTable('getOptions');
|
|
|
- Fast.api.open(options.extend.edit_url + "/ids/" + row[options.pk], __('Edit'));
|
|
|
+ Fast.api.open(options.extend.edit_url + (options.extend.edit_url.match(/(\?|&)+/) ? "&ids=" : "/ids/") + row[options.pk], __('Edit'));
|
|
|
},
|
|
|
'click .btn-delone': function (e, value, row, index) {
|
|
|
e.stopPropagation();
|