MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / handleResize

Method handleResize

data/src/emulator.js:4097–4115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4095 this.virtualGamepad.style.display = "none";
4096 }
4097 handleResize() {
4098 if (this.virtualGamepad) {
4099 if (this.virtualGamepad.style.display === "none") {
4100 this.virtualGamepad.style.opacity = 0;
4101 this.virtualGamepad.style.display = "";
4102 setTimeout(() => {
4103 this.virtualGamepad.style.display = "none";
4104 this.virtualGamepad.style.opacity = "";
4105 }, 250)
4106 }
4107 }
4108 const positionInfo = this.elements.parent.getBoundingClientRect();
4109 this.game.parentElement.classList.toggle("ejs_small_screen", positionInfo.width <= 575);
4110 //This wouldnt work using :not()... strange.
4111 this.game.parentElement.classList.toggle("ejs_big_screen", positionInfo.width > 575);
4112
4113 if (!this.handleSettingsResize) return;
4114 this.handleSettingsResize();
4115 }
4116 getElementSize(element) {
4117 let elem = element.cloneNode(true);
4118 elem.style.position = "absolute";

Callers 3

constructorMethod · 0.95
startGameErrorMethod · 0.95
startGameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected