aboutsummaryrefslogtreecommitdiff
path: root/pointless/viewer/screen.js
diff options
context:
space:
mode:
Diffstat (limited to 'pointless/viewer/screen.js')
-rw-r--r--pointless/viewer/screen.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/pointless/viewer/screen.js b/pointless/viewer/screen.js
index 0c1c3ad..28f4f55 100644
--- a/pointless/viewer/screen.js
+++ b/pointless/viewer/screen.js
@@ -8,7 +8,7 @@
8"use strict"; 8"use strict";
9 9
10class Screen { 10class Screen {
11 constructor(window, secondary=false) { 11 constructor(window, secondary=false, withTimer=false) {
12 this.window = window; 12 this.window = window;
13 this.secondary = secondary; 13 this.secondary = secondary;
14 this.canvas = window.document.getElementById("screen"); 14 this.canvas = window.document.getElementById("screen");
@@ -19,11 +19,18 @@ class Screen {
19 this.window.addEventListener("resize", function() { 19 this.window.addEventListener("resize", function() {
20 self._refreshPage(); 20 self._refreshPage();
21 }); 21 });
22
23 this.timer = withTimer ? new Timer(window) : null;
24 this.pageTurnCount = 0;
22 } 25 }
23 26
24 setPage(page) { 27 setPage(page) {
28 if (this.pageTurnCount === 1 && this.timer != null)
29 this.timer.start();
30
25 this.page = page; 31 this.page = page;
26 this._refreshPage(); 32 this._refreshPage();
33 this.pageTurnCount++;
27 } 34 }
28 35
29 _resizeScreen(ratio) { 36 _resizeScreen(ratio) {