Skip to content

Commit fa3a066

Browse files
Alex VinoberAlex Vinober
Alex Vinober
authored and
Alex Vinober
committed
Right click test, buttons instead button, test updated
1 parent 7c2b91e commit fa3a066

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/components/dragelement/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dragElement.init = function init(options) {
7878
element.ontouchstart = onStart;
7979

8080
function onStart(e) {
81-
if(e.button && e.button === 2) { // right click
81+
if(e.buttons && e.buttons === 2) { // right click
8282
return;
8383
}
8484

test/jasmine/tests/dragelement_test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ describe('dragElement', function() {
130130
var options = { element: this.element, gd: this.gd };
131131
dragElement.init(options);
132132

133-
options.element.onmousedown({button: 2})
134-
133+
mouseEvent('mousedown', this.x, this.y, { buttons: 2 });
135134
expect(countCoverSlip()).toEqual(0);
136135
});
137136

0 commit comments

Comments
 (0)