Skip to content

Commit

Permalink
chore(hand-tool): consistently use self in event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Dec 15, 2020
1 parent 0c44429 commit 133f80c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/features/hand-tool/HandTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default function HandTool(

eventBus.on('element.mousedown', HIGH_PRIORITY, function(event) {
if (hasPrimaryModifier(event)) {
this.activateMove(event.originalEvent, true);
self.activateMove(event.originalEvent, true);

return false;
}
}, this);
});

keyboard && keyboard.addListener(HIGH_PRIORITY, function(e) {
if (!isSpace(e.keyEvent) || self.isActive()) {
Expand Down Expand Up @@ -57,10 +57,10 @@ export default function HandTool(
}

eventBus.once('hand.ended', function() {
this.activateMove(event.originalEvent, { reactivate: true });
}, this);
self.activateMove(event.originalEvent, { reactivate: true });
});

}, this);
});

eventBus.on('hand.move.move', function(event) {
var scale = canvas.viewbox().scale;
Expand All @@ -79,13 +79,13 @@ export default function HandTool(
if (!hasPrimaryModifier(event) && reactivate) {

eventBus.once('hand.move.ended', function(event) {
this.activateHand(event.originalEvent, true, true);
}, this);
self.activateHand(event.originalEvent, true, true);
});

}

return false;
}, this);
});

}

Expand Down

0 comments on commit 133f80c

Please sign in to comment.