Skip to content

Commit

Permalink
测试页新增游戏时全屏切换
Browse files Browse the repository at this point in the history
  • Loading branch information
MisaLiu committed Oct 27, 2022
1 parent c6508f0 commit b7dc653
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
GitHub homepage: <a href="https://github.com/MisaLiu/phi-chart-render" target="_blank">https://github.com/MisaLiu/phi-chart-render</a><br>
Report bugs <a href="https://github.com/MisaLiu/phi-chart-render/issues/new/choose" target="_blank">Here</a>

<button class="fullscreen" id="fullscreen">Fullscreen</button>
<button onclick="fullscreen.toggle(document.body, false)" class="fullscreen" id="fullscreen">Fullscreen</button>
</div>

<div class="debug-value"></div>
Expand Down Expand Up @@ -290,6 +290,7 @@
<div class="game-paused">
<div class="title">Game paused</div>
<div class="action">
<button onclick="fullscreen.toggle(document.body, false)">Fullscreen</button>
<button onclick="exitGame()">Exit</button>
<button onclick="restartGame()">Restart</button>
<button onclick="pauseGame()">Continue</button>
Expand Down
6 changes: 1 addition & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ window.doms = doms;
window.files = files;
window.assets = assets;
window.currentFile = currentFile;
window.fullscreen = fullscreen;

window.loader = new Loader();

Expand Down Expand Up @@ -455,11 +456,6 @@ doms.startBtn.addEventListener('click', async () => {
doms.fileSelect.style.display = 'none';
});

doms.fullscreenBtn.addEventListener('click', () =>
{
fullscreen.toggle(document.body, false);
});

window.addEventListener('error', (err) =>
{
doms.errorWindow.content.innerText = (err.error && err.error.stack ? err.error.stack : err.error.message);
Expand Down

0 comments on commit b7dc653

Please sign in to comment.