Skip to content

Commit

Permalink
Don't toggle canvas on right-mouse click
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasvh committed Aug 10, 2017
1 parent 5969c95 commit 8f575a4
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,24 @@ var REFTEST = window.location.search.indexOf('reftest') !== -1;
.appendTo(document.body);
if (!CI) {
$canvas.siblings().toggle();
$(window).click(function() {
var scrollTop = $(window).scrollTop();
$canvas.toggle().siblings().toggle();
$(document.documentElement).css(
'background',
$canvas.is(':visible') ? 'none' : ''
);
$(document.body).css(
'background',
$canvas.is(':visible') ? 'none' : ''
);
throwMessage(
'Canvas Render ' + ($canvas.is(':visible') ? 'visible' : 'hidden')
);
$(window).scrollTop(scrollTop);
$(window).click(function(event) {
if (event.button === 0) {
var scrollTop = $(window).scrollTop();
$canvas.toggle().siblings().toggle();
$(document.documentElement).css(
'background',
$canvas.is(':visible') ? 'none' : ''
);
$(document.body).css(
'background',
$canvas.is(':visible') ? 'none' : ''
);
throwMessage(
'Canvas Render ' +
($canvas.is(':visible') ? 'visible' : 'hidden')
);
$(window).scrollTop(scrollTop);
}
});
$(document.documentElement).css(
'background',
Expand Down

0 comments on commit 8f575a4

Please sign in to comment.