mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 09:50:09 +00:00
added splash screen timeout...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ca3ca35b84
commit
7b7f680e36
17
Viewer/e.js
17
Viewer/e.js
@ -54,6 +54,7 @@ global.START_GUI = false
|
||||
//
|
||||
// XXX might be nice to show load progress on splash...
|
||||
var SPLASH
|
||||
var SPLASH_TIMEOUT = 20 * 1000
|
||||
function createSplash(force=false){
|
||||
// singleton window...
|
||||
if(!force && SPLASH){
|
||||
@ -110,6 +111,14 @@ function createSplash(force=false){
|
||||
WIN
|
||||
&& WIN.webContents.executeJavaScript('document.appSplashScreen = true')
|
||||
|
||||
// auto-close splash...
|
||||
SPLASH_TIMEOUT
|
||||
&& setTimeout(
|
||||
function(){
|
||||
SPLASH
|
||||
&& SPLASH.destroy() },
|
||||
SPLASH_TIMEOUT)
|
||||
|
||||
return SPLASH }
|
||||
|
||||
|
||||
@ -238,12 +247,16 @@ ipcMain.on('exitFullScreen',
|
||||
|
||||
// Splash screen...
|
||||
ipcMain.on('openSplashScreen',
|
||||
function(){ SPLASH || createSplash() })
|
||||
function(){
|
||||
SPLASH
|
||||
|| createSplash() })
|
||||
ipcMain.on('closeSplashScreen',
|
||||
function(){
|
||||
// force this to run after this frame avoiding races...
|
||||
setTimeout(
|
||||
function(){ SPLASH && SPLASH.destroy() },
|
||||
function(){
|
||||
SPLASH
|
||||
&& SPLASH.destroy() },
|
||||
10) })
|
||||
|
||||
// DevTools...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user