mirror of https://gitee.com/karson/fastadmin.git
优化事件绑定
parent
e6f2894af7
commit
80ad9e307a
|
|
@ -562,15 +562,15 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||||
table.on("click", ".autocontent-caret", function () {
|
table.on("click", ".autocontent-caret", function () {
|
||||||
var text = $(this).prev().text();
|
var text = $(this).prev().text();
|
||||||
var tdrect = $(this).parent().get(0).getBoundingClientRect();
|
var tdrect = $(this).parent().get(0).getBoundingClientRect();
|
||||||
tdrect.x += document.documentElement.scrollLeft;
|
|
||||||
tdrect.y += document.documentElement.scrollTop;
|
|
||||||
var index = Layer.open({id: 'autocontent', skin: 'layui-layer-fast layui-layer-autocontent', title: false, content: text, btn: false, anim: false, shade: 0, isOutAnim: false, area: 'auto', maxWidth: 450, maxHeight: 350, offset: [tdrect.y, tdrect.x]});
|
var index = Layer.open({id: 'autocontent', skin: 'layui-layer-fast layui-layer-autocontent', title: false, content: text, btn: false, anim: false, shade: 0, isOutAnim: false, area: 'auto', maxWidth: 450, maxHeight: 350, offset: [tdrect.y, tdrect.x]});
|
||||||
|
|
||||||
$(document).one("mousedown", function (e) {
|
var mousedown = function (e) {
|
||||||
if ($(e.target).closest(".layui-layer").length === 0) {
|
if ($(e.target).closest(".layui-layer").length === 0) {
|
||||||
Layer.close(index);
|
Layer.close(index);
|
||||||
|
$(document).off("mousedown", mousedown);
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
$(document).off("mousedown", mousedown).on("mousedown", mousedown);
|
||||||
});
|
});
|
||||||
|
|
||||||
//修复dropdown定位溢出的情况
|
//修复dropdown定位溢出的情况
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue