Skip to content

Commit

Permalink
replace Array.fill with for loop (IE support)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakedowns committed Dec 18, 2019
1 parent 3714348 commit dbaf781
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mixins/canvas_events.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,13 @@
_fireOverOutEvents: function(target, e) {
var _this = this, _hoveredTarget = this._hoveredTarget,
_hoveredTargets = this._hoveredTargets, targets = this.targets,
diff = _hoveredTargets.length - targets.length;
[target].concat(targets, new Array(diff > 0 ? diff : 0).fill(null)).forEach(function(_target, index) {
diff = _hoveredTargets.length - targets.length,
diffArrayLength = diff > 0 ? diff : 0,
diffArray = [];
for (var i = 0; i < diffArrayLength; i++){
diffArray.push(null);
}
[target].concat(targets, diffArray).forEach(function(_target, index) {
_this.fireSyntheticInOutEvents(_target, e, {
oldTarget: index === 0 ? _hoveredTarget : _hoveredTargets[index - 1],
canvasEvtOut: 'mouse:out',
Expand Down

0 comments on commit dbaf781

Please sign in to comment.