Don't toggle canvas on right-mouse click

This commit is contained in:
Niklas von Hertzen 2017-08-10 21:59:26 +08:00
parent 5969c95481
commit 8f575a446d

View File

@ -65,7 +65,8 @@ var REFTEST = window.location.search.indexOf('reftest') !== -1;
.appendTo(document.body); .appendTo(document.body);
if (!CI) { if (!CI) {
$canvas.siblings().toggle(); $canvas.siblings().toggle();
$(window).click(function() { $(window).click(function(event) {
if (event.button === 0) {
var scrollTop = $(window).scrollTop(); var scrollTop = $(window).scrollTop();
$canvas.toggle().siblings().toggle(); $canvas.toggle().siblings().toggle();
$(document.documentElement).css( $(document.documentElement).css(
@ -77,9 +78,11 @@ var REFTEST = window.location.search.indexOf('reftest') !== -1;
$canvas.is(':visible') ? 'none' : '' $canvas.is(':visible') ? 'none' : ''
); );
throwMessage( throwMessage(
'Canvas Render ' + ($canvas.is(':visible') ? 'visible' : 'hidden') 'Canvas Render ' +
($canvas.is(':visible') ? 'visible' : 'hidden')
); );
$(window).scrollTop(scrollTop); $(window).scrollTop(scrollTop);
}
}); });
$(document.documentElement).css( $(document.documentElement).css(
'background', 'background',