Replace '_.reduce' to 'Array.prototype.reduce'

This commit is contained in:
Hongarc 2018-12-01 08:22:40 +07:00
parent 7af2db3da5
commit e324e51587

View file

@ -85,7 +85,7 @@ var GitDemonstrationView = ContainedBase.extend({
checkScroll: function() {
var children = this.$('div.demonstrationText').children().toArray();
var heights = children.map(function(child) { return child.clientHeight; });
var totalHeight = _.reduce(heights, function(a, b) { return a + b; });
var totalHeight = heights.reduce(function(a, b) { return a + b; });
if (totalHeight < this.$('div.demonstrationText').height()) {
this.$('div.demonstrationText').addClass('noLongText');
}