MCPcopy
hub / github.com/layui/layui / addPatch

Function addPatch

src/modules/table.js:2566–2582  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

2564
2565 // 添加补丁
2566 var addPatch = function (elem) {
2567 if (scrollWidth && scrollHeight) {
2568 elem = elem.eq(0);
2569 var patchElem = elem.find('.layui-table-patch');
2570 if (!patchElem[0]) {
2571 patchElem = $(
2572 '<th class="layui-table-patch"><div class="layui-table-cell"></div></th>'
2573 ); // 补丁元素
2574 elem.find('tr').append(patchElem);
2575 }
2576 patchElem.find('div').css({
2577 width: scrollWidth
2578 });
2579 } else {
2580 elem.find('.layui-table-patch').remove();
2581 }
2582 };
2583
2584 addPatch(that.layHeader);
2585 addPatch(that.layTotal);

Callers 1

table.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected