Skip to content

Commit ddee771

Browse files
committed
Fixed an issue with mouse button detection in ExpressionHover.
Signed-off-by: Grant Skinner <[email protected]>
1 parent 9af1fca commit ddee771

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

js/ExpressionHover.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ SOFTWARE.
4848
cm.on("mousedown", $.bind(this, this.onMouseDown));
4949
};
5050

51-
p.onMouseDown = function(evt) {
52-
if (evt.which != 1) { return; }
53-
this.onMouseMove(); // clear current
54-
this.isMouseDown = true;
55-
(window.addEventListener ? window : document).addEventListener("mouseup", $.bind(this, this.onMouseUp));
51+
p.onMouseDown = function(cm, evt) {
52+
if (evt.which == 1 || evt.button == 1) {
53+
this.onMouseMove(); // clear current
54+
this.isMouseDown = true;
55+
(window.addEventListener ? window : document).addEventListener("mouseup", $.bind(this, this.onMouseUp));
56+
}
5657
};
5758

5859
p.onMouseUp = function(evt) {
59-
if (evt.which != 1) { return; }
60-
this.isMouseDown = false;
60+
if (evt.button == 1 || evt.which == 1) { this.isMouseDown = false; }
6161
};
6262

6363
p.onMouseMove = function(evt) {

0 commit comments

Comments
 (0)