diff options
Diffstat (limited to 'index.html')
-rw-r--r-- | index.html | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -16,9 +16,18 @@ </body> <script> - Elm.fullscreen(Elm.Main, { - initialTime: new Date().getTime() - }); + var timer = Elm.fullscreen(Elm.Main, { + initialTime: new Date().getTime(), + clickAway: [] + }); + + timer.ports.clickPosition.subscribe(function(pos) { + const element = document.elementFromPoint(pos.x, pos.y); + if(element.nodeName != 'BUTTON') { + timer.ports.clickAway.send([]); + } + }); + </script> </html> |