mirror of
https://gitee.com/layui/layui.git
synced 2025-11-24 08:33:12 +08:00
@@ -503,9 +503,14 @@ Class.prototype.render = function (type) {
|
||||
that.fullSize();
|
||||
that.setColsWidth({ isInit: true });
|
||||
|
||||
that.pullData(that.page); // 请求数据
|
||||
// 请求数据
|
||||
that.pullData(that.page, {
|
||||
done: function () {
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
},
|
||||
});
|
||||
|
||||
that.events(); // 事件
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
};
|
||||
|
||||
// 根据列类型,定制化参数
|
||||
@@ -1286,6 +1291,7 @@ Class.prototype.pullData = function (curr, opts) {
|
||||
that.loading(false);
|
||||
typeof options.done === 'function' &&
|
||||
options.done(res, curr, res[response.countName], origin);
|
||||
typeof opts.done === 'function' && opts.done();
|
||||
};
|
||||
|
||||
opts = opts || {};
|
||||
@@ -3406,12 +3412,14 @@ Class.prototype.observeResize = function () {
|
||||
|
||||
var el = that.elem[0];
|
||||
var tableEl = that.layMain.children('table')[0];
|
||||
|
||||
// 显示或隐藏时重置列宽
|
||||
resizeObserver.observe(el, $.proxy(that.resize, that));
|
||||
resizeObserver.observe(el, that.resize.bind(that));
|
||||
|
||||
// 同步固定列表格和主表格高度
|
||||
var lineStyle = that.config.lineStyle;
|
||||
var isAutoHeight = lineStyle && /\bheight\s*:\s*auto\b/g.test(lineStyle);
|
||||
|
||||
// 只重载数据时需要主动同步高度,因为 tbody 大小可能不变
|
||||
var needSyncFixedRowHeight = (that.needSyncFixedRowHeight =
|
||||
that.layBody.length > 1 &&
|
||||
@@ -3419,7 +3427,7 @@ Class.prototype.observeResize = function () {
|
||||
(that.config.syncFixedRowHeight !== false && isAutoHeight)));
|
||||
|
||||
if (needSyncFixedRowHeight) {
|
||||
resizeObserver.observe(tableEl, $.proxy(that.calcFixedRowHeight, that));
|
||||
resizeObserver.observe(tableEl, that.calcFixedRowHeight.bind(that));
|
||||
}
|
||||
|
||||
that.unobserveResize = function () {
|
||||
|
||||
659
tests/visual/assets/dist/css/layui.css
vendored
659
tests/visual/assets/dist/css/layui.css
vendored
File diff suppressed because one or more lines are too long
2
tests/visual/assets/dist/css/layui.css.map
vendored
2
tests/visual/assets/dist/css/layui.css.map
vendored
File diff suppressed because one or more lines are too long
16
tests/visual/assets/dist/layui.esm.js
vendored
16
tests/visual/assets/dist/layui.esm.js
vendored
@@ -24339,9 +24339,14 @@ Class$6.prototype.render = function (type) {
|
||||
that.setColsWidth({
|
||||
isInit: true
|
||||
});
|
||||
that.pullData(that.page); // 请求数据
|
||||
|
||||
// 请求数据
|
||||
that.pullData(that.page, {
|
||||
done: function () {
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
}
|
||||
});
|
||||
that.events(); // 事件
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
};
|
||||
|
||||
// 根据列类型,定制化参数
|
||||
@@ -24978,6 +24983,7 @@ Class$6.prototype.pullData = function (curr, opts) {
|
||||
that.setColsWidth();
|
||||
that.loading(false);
|
||||
typeof options.done === 'function' && options.done(res, curr, res[response.countName], origin);
|
||||
typeof opts.done === 'function' && opts.done();
|
||||
};
|
||||
opts = opts || {};
|
||||
|
||||
@@ -26714,16 +26720,18 @@ Class$6.prototype.observeResize = function () {
|
||||
that.unobserveResize();
|
||||
var el = that.elem[0];
|
||||
var tableEl = that.layMain.children('table')[0];
|
||||
|
||||
// 显示或隐藏时重置列宽
|
||||
resizeObserver.observe(el, $.proxy(that.resize, that));
|
||||
resizeObserver.observe(el, that.resize.bind(that));
|
||||
|
||||
// 同步固定列表格和主表格高度
|
||||
var lineStyle = that.config.lineStyle;
|
||||
var isAutoHeight = lineStyle && /\bheight\s*:\s*auto\b/g.test(lineStyle);
|
||||
|
||||
// 只重载数据时需要主动同步高度,因为 tbody 大小可能不变
|
||||
var needSyncFixedRowHeight = that.needSyncFixedRowHeight = that.layBody.length > 1 && (that.config.syncFixedRowHeight || that.config.syncFixedRowHeight !== false && isAutoHeight);
|
||||
if (needSyncFixedRowHeight) {
|
||||
resizeObserver.observe(tableEl, $.proxy(that.calcFixedRowHeight, that));
|
||||
resizeObserver.observe(tableEl, that.calcFixedRowHeight.bind(that));
|
||||
}
|
||||
that.unobserveResize = function () {
|
||||
resizeObserver.unobserve(el);
|
||||
|
||||
2
tests/visual/assets/dist/layui.esm.js.map
vendored
2
tests/visual/assets/dist/layui.esm.js.map
vendored
File diff suppressed because one or more lines are too long
16
tests/visual/assets/dist/layui.js
vendored
16
tests/visual/assets/dist/layui.js
vendored
@@ -24342,9 +24342,14 @@ var layui = (function () {
|
||||
that.setColsWidth({
|
||||
isInit: true
|
||||
});
|
||||
that.pullData(that.page); // 请求数据
|
||||
|
||||
// 请求数据
|
||||
that.pullData(that.page, {
|
||||
done: function () {
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
}
|
||||
});
|
||||
that.events(); // 事件
|
||||
that.observeResize(); // 观察尺寸变化
|
||||
};
|
||||
|
||||
// 根据列类型,定制化参数
|
||||
@@ -24981,6 +24986,7 @@ var layui = (function () {
|
||||
that.setColsWidth();
|
||||
that.loading(false);
|
||||
typeof options.done === 'function' && options.done(res, curr, res[response.countName], origin);
|
||||
typeof opts.done === 'function' && opts.done();
|
||||
};
|
||||
opts = opts || {};
|
||||
|
||||
@@ -26717,16 +26723,18 @@ var layui = (function () {
|
||||
that.unobserveResize();
|
||||
var el = that.elem[0];
|
||||
var tableEl = that.layMain.children('table')[0];
|
||||
|
||||
// 显示或隐藏时重置列宽
|
||||
resizeObserver.observe(el, jquery.proxy(that.resize, that));
|
||||
resizeObserver.observe(el, that.resize.bind(that));
|
||||
|
||||
// 同步固定列表格和主表格高度
|
||||
var lineStyle = that.config.lineStyle;
|
||||
var isAutoHeight = lineStyle && /\bheight\s*:\s*auto\b/g.test(lineStyle);
|
||||
|
||||
// 只重载数据时需要主动同步高度,因为 tbody 大小可能不变
|
||||
var needSyncFixedRowHeight = that.needSyncFixedRowHeight = that.layBody.length > 1 && (that.config.syncFixedRowHeight || that.config.syncFixedRowHeight !== false && isAutoHeight);
|
||||
if (needSyncFixedRowHeight) {
|
||||
resizeObserver.observe(tableEl, jquery.proxy(that.calcFixedRowHeight, that));
|
||||
resizeObserver.observe(tableEl, that.calcFixedRowHeight.bind(that));
|
||||
}
|
||||
that.unobserveResize = function () {
|
||||
resizeObserver.unobserve(el);
|
||||
|
||||
2
tests/visual/assets/dist/layui.js.map
vendored
2
tests/visual/assets/dist/layui.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user