Skip to content

Commit

Permalink
🐛 Fix double-tap iOS #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul de Vries committed Dec 12, 2017
1 parent 214dc74 commit c599126
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions octoprint_fullscreen/static/js/fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,23 @@ $(function() {
return output;
};

$webcam.on("dblclick", function() {
$body.toggleClass('inlineFullscreen');
$container.toggleClass("inline fullscreen");

if(self.printer.isFullscreen()) {
$fullscreenContainer.toggleFullScreen();

var touchtime = 0;
$webcam.on("click", function() {
if (touchtime == 0) {
touchtime = new Date().getTime();
} else {
if (((new Date().getTime()) - touchtime) < 800) {
$body.toggleClass('inlineFullscreen');
$container.toggleClass("inline fullscreen");

if(self.printer.isFullscreen()) {
$fullscreenContainer.toggleFullScreen();
}
touchtime = 0;
} else {
touchtime = new Date().getTime();
}
}
});

Expand Down

0 comments on commit c599126

Please sign in to comment.