pxt-arcade 1.11.18 → 1.11.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/built/sim.js CHANGED
@@ -162,7 +162,15 @@ var pxsim;
162
162
  setSimThemeColor("dpad-fill", searchParams.get("dpad-fill"));
163
163
  if (!!searchParams.get("pointer-events"))
164
164
  registerPointerEvents();
165
+ if (!!searchParams.get("hideSimButtons"))
166
+ hideSimButtons();
165
167
  });
168
+ function hideSimButtons() {
169
+ const gamePlayer = document.getElementsByClassName("game-player");
170
+ if (gamePlayer && gamePlayer.length) {
171
+ gamePlayer[0].classList.add("just-screen");
172
+ }
173
+ }
166
174
  function registerPointerEvents() {
167
175
  const canvas = document.getElementById("game-screen");
168
176
  const encoder = new TextEncoder();
@@ -295,17 +303,6 @@ var pxsim;
295
303
  }
296
304
  }
297
305
  };
298
- window.onload = function (e) {
299
- const url = new URL(document.location.toString());
300
- if (url.searchParams.get("hideSimButtons") === "1") {
301
- const gamePlayer = document.getElementsByClassName("game-player");
302
- if (gamePlayer && gamePlayer.length) {
303
- document
304
- .getElementsByClassName("game-player")[0]
305
- .classList.add("just-screen");
306
- }
307
- }
308
- };
309
306
  window.addEventListener("message", (ev) => {
310
307
  if (ev.data.button !== undefined) {
311
308
  let key;