Skip to content

Commit 8312218

Browse files
committed
update
1 parent 72444e5 commit 8312218

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

public/assets/backend/js/responsive-table/js/rwd-table.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
this.options = options;
1919
this.$tableWrapper = null; //defined later in wrapTable
2020
this.$tableScrollWrapper = $(element); //defined later in wrapTable
21-
this.$table = $(element).find("table");
21+
this.$table = $(element).find("table:first");
2222

2323
if (this.$table.length !== 1) {
2424
throw new Error(
@@ -41,9 +41,9 @@
4141
this.$stickyTableHeader = null; //defined farther down
4242

4343
//good to have - for easy access
44-
this.$thead = this.$table.find("thead");
44+
this.$thead = this.$table.children("thead");
4545
this.$hdrCells = this.$thead.find("tr").first().find("th");
46-
this.$bodyRows = this.$table.find("tbody, tfoot").find("tr");
46+
this.$bodyRows = this.$table.children("tbody, tfoot").children("tr");
4747

4848
//toolbar and buttons
4949
this.$btnToolbar = null; //defined farther down
@@ -276,10 +276,10 @@
276276
if ($("html").hasClass("lt-ie9")) {
277277
displayProp = "inline";
278278
}
279-
280-
$(this.$table).find("th, td").css("display", displayProp);
279+
var cellE = "> thead > tr > th, > thead > tr > td,> tfoot > tr > th, > tfoot > tr > td,> tbody > tr > th, > tbody > tr > td";
280+
$(this.$table).find(cellE).css("display", displayProp);
281281
if (this.$tableClone) {
282-
$(this.$tableClone).find("th, td").css("display", displayProp);
282+
$(this.$tableClone).find(cellE).css("display", displayProp);
283283
}
284284
};
285285

@@ -614,7 +614,7 @@
614614
var idStart = 0;
615615

616616
// for each cell
617-
$row.find("th, td").each(function () {
617+
$row.children("th, td").each(function () {
618618
var $cell = $(this);
619619
var columnsAttr = "";
620620

@@ -705,14 +705,14 @@
705705

706706
// Run this after the content in tbody has changed
707707
ResponsiveTable.prototype.update = function () {
708-
this.$bodyRows = this.$table.find("tbody, tfoot").find("tr");
708+
this.$bodyRows = this.$table.children("tbody, tfoot").children("tr");
709709
this.setupBodyRows();
710710

711711
// Remove old tbody clone from Tableclone
712-
this.$tableClone.find("tbody, tfoot").remove();
712+
this.$tableClone.children("tbody, tfoot").remove();
713713

714714
// Make new clone of tbody
715-
var $tbodyClone = this.$table.find("tbody, tfoot").clone();
715+
var $tbodyClone = this.$table.children("tbody, tfoot").clone();
716716

717717
//replace ids
718718
$tbodyClone.find("[id]").each(function () {

0 commit comments

Comments
 (0)