- /**
- * Toggle the visibility of columns based on their priority.
- *
- * Columns are classed with either 'priority-low' or 'priority-medium'.
- *
- * @param {jQuery.Event} e
- * The event triggered.
- */
- eventhandlerToggleColumns(e) {
- e.preventDefault();
- const self = this;
- const $hiddenHeaders = this.$headers.filter('.priority-medium:hidden, .priority-low:hidden');
- this.$revealedCells = this.$revealedCells || $();
- // Reveal hidden columns.
- if ($hiddenHeaders.length > 0) {
- $hiddenHeaders.each(function (index, element) {
- const $header = $(this);
- const position = $header.prevAll('th').length;
- self.$table.find('tbody tr').each(function () {
- const $cells = $(this).find('td').eq(position);
- $cells.show();
- // Keep track of the revealed cells, so they can be hidden later.
- self.$revealedCells = $().add(self.$revealedCells).add($cells);
+ /**
+ * Toggle the visibility of columns based on their priority.
+ *
+ * Columns are classed with either 'priority-low' or 'priority-medium'.
+ *
+ * @param {jQuery.Event} e
+ * The event triggered.
+ */
+ eventhandlerToggleColumns(e) {
+ e.preventDefault();
+ const self = this;
+ const $hiddenHeaders = this.$headers.filter(
+ '.priority-medium:hidden, .priority-low:hidden',
+ );
+ this.$revealedCells = this.$revealedCells || $();
+ // Reveal hidden columns.
+ if ($hiddenHeaders.length > 0) {
+ $hiddenHeaders.each(function(index, element) {
+ const $header = $(this);
+ const position = $header.prevAll('th').length;
+ self.$table.find('tbody tr').each(function() {
+ const $cells = $(this)
+ .find('td')
+ .eq(position);
+ $cells.show();
+ // Keep track of the revealed cells, so they can be hidden later.
+ self.$revealedCells = $()
+ .add(self.$revealedCells)
+ .add($cells);
+ });
+ $header.show();
+ // Keep track of the revealed headers, so they can be hidden later.
+ self.$revealedCells = $()
+ .add(self.$revealedCells)
+ .add($header);