diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js index 0127ec8..fcbdde9 100644 --- a/core/misc/tableresponsive.js +++ b/core/misc/tableresponsive.js @@ -139,28 +139,12 @@ this.$revealedCells.hide(); // Strip the 'display:none' declaration from the style attributes of // the table cells that .hide() added. - this.$revealedCells.each(function (index, element) { - var $cell = $(this); - var properties = $cell.attr('style').split(';'); - var newProps = []; - // The hide method adds display none to the element. The element - // should be returned to the same state it was in before the columns - // were revealed, so it is necessary to remove the display none value - // from the style attribute. - var match = /^display\s*\:\s*none$/; - for (var i = 0; i < properties.length; i++) { - var prop = properties[i]; - prop.trim(); - // Find the display:none property and remove it. - var isDisplayNone = match.exec(prop); - if (isDisplayNone) { - continue; - } - newProps.push(prop); - } - // Return the rest of the style attribute values to the element. - $cell.attr('style', newProps.join(';')); - }); + // The hide method adds display none to the element. The element + // should be returned to the same state it was in before the columns + // were revealed, so it is necessary to remove the display none value + // from the style attribute. + // Return the rest of the style attribute values to the element. + this.$revealedCells.css('display', ''); this.$link.text(this.showText).data('pegged', 0); // Refresh the toggle link. $(window).trigger('resize.tableresponsive');