From 21b3595c8fc71aaa869fe0e50c910e54851e39e7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 07:38:11 +0300 Subject: fix for lack of prototype --- init.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.js b/init.js index 4a31399..18733dc 100644 --- a/init.js +++ b/init.js @@ -1,14 +1,14 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { ready(function () { - Event.observe(window, "focus", function() { - $$("video").forEach((vid) => { + window.addEventListener("focus", function() { + App.findAll("video").forEach((vid) => { if (vid.getAttribute("autoplay") == 1 && vid.paused) vid.play(); }) }); - Event.observe(window, "blur", function() { - $$("video").forEach((vid) => { + window.addEventListener("blur", function() { + App.findAll("video").forEach((vid) => { if (vid.getAttribute("autoplay") == 1 && !vid.paused) vid.pause(); }) -- cgit v1.2.3