changed "maximize" window button to fullscreen instead

- this closes #46
This commit is contained in:
R. Aidan Campbell 2016-05-05 18:05:57 -04:00
parent 35fb2c45ec
commit f39b6486bf

View File

@ -19,6 +19,18 @@ function attachListeners() {
$('#continueReplaceApp').on('click', continueReplaceApp);
$('#quitGameButton').on('click', stopGame);
$(window).resize(fullscreenNaclModule);
chrome.app.window.current().onMaximized.addListener(fullscreenChromeWindow);
}
function fullscreenChromeWindow() {
// when the user clicks the maximize button on the window,
// FIRST restore it to the previous size, then fullscreen it to the whole screen
// this prevents the previous window size from being 'maximized',
// and allows us to functionally retain two window sizes
// so that when the user hits `esc`, they go back to the "restored" size,
// instead of "maximized", which would immediately go to fullscreen
chrome.app.window.current().restore();
chrome.app.window.current().fullscreen();
}
function snackbarLog(givenMessage) {