Last active
December 17, 2015 02:29
-
-
Save lsmith/5536394 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_toggleStripes: function (index) { | |
var task = this._toggleStripesTask, | |
self; | |
// index|0 to force int, avoid NaN. Math.max() to avoid neg indexes. | |
index = Math.max((index|0), 0); | |
if (!task) { | |
self = this; | |
this._toggleStripesTask = { | |
timer: setTimeout(function () { | |
var odd = [this.CLASS_ODD, this.CLASS_EVEN], | |
even = [this.CLASS_EVEN, this.CLASS_ODD]; | |
self.tbodyNode.get('childNodes') | |
.slice(self._toggleStripeTask.index) | |
.each(function (row, i) { | |
row.replaceClass.apply(row, (index + i) % 2 ? odd : even); | |
}); | |
this._toggleStripesTask = null; | |
}, 0), | |
index: index | |
} | |
} else { | |
task.index = Math.min(task.index, index); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment