| 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); |