diff --git a/core/includes/theme.inc b/core/includes/theme.inc index cccc4ccd57778b18a8b90b172b08396f895dd341..9ce21ff1b8a00b3c746f1fbd18b63308806c2636 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1042,6 +1042,9 @@ function template_preprocess_table(&$variables) { } } } + if (empty($variables['no_striping'])) { + $variables['attributes']['data-striping'] = 1; + } } /** diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 1e61eff8e9b1ef47532c13a25c98629b46770399..0795e3046af6365311f4632d539c6194300d2639 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -60,6 +60,7 @@ this.changed = false; // Whether anything in the entire table has changed. this.maxDepth = 0; // Maximum amount of allowed parenting. this.rtl = $(this.table).css('direction') === 'rtl' ? -1 : 1; // Direction of the table. + this.striping = $(this.table).data('striping') === 1; // Configure the scroll settings. this.scrollSettings = {amount: 4, interval: 50, trigger: 70}; @@ -459,7 +460,9 @@ $(self.oldRowElement).removeClass('drag-previous'); } self.oldRowElement = item; - self.restripeTable(); + if (self.striping === true) { + self.restripeTable(); + } self.onDrag(); } @@ -556,7 +559,9 @@ else { self.rowObject.swap('before', currentRow, self); } - self.restripeTable(); + if (self.striping === true) { + self.restripeTable(); + } } }