mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +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...
|
// XXX might be nice to show load progress on splash...
|
||||||
var SPLASH
|
var SPLASH
|
||||||
|
var SPLASH_TIMEOUT = 20 * 1000
|
||||||
function createSplash(force=false){
|
function createSplash(force=false){
|
||||||
// singleton window...
|
// singleton window...
|
||||||
if(!force && SPLASH){
|
if(!force && SPLASH){
|
||||||
@ -110,6 +111,14 @@ function createSplash(force=false){
|
|||||||
WIN
|
WIN
|
||||||
&& WIN.webContents.executeJavaScript('document.appSplashScreen = true')
|
&& WIN.webContents.executeJavaScript('document.appSplashScreen = true')
|
||||||
|
|
||||||
|
// auto-close splash...
|
||||||
|
SPLASH_TIMEOUT
|
||||||
|
&& setTimeout(
|
||||||
|
function(){
|
||||||
|
SPLASH
|
||||||
|
&& SPLASH.destroy() },
|
||||||
|
SPLASH_TIMEOUT)
|
||||||
|
|
||||||
return SPLASH }
|
return SPLASH }
|
||||||
|
|
||||||
|
|
||||||
@ -238,12 +247,16 @@ ipcMain.on('exitFullScreen',
|
|||||||
|
|
||||||
// Splash screen...
|
// Splash screen...
|
||||||
ipcMain.on('openSplashScreen',
|
ipcMain.on('openSplashScreen',
|
||||||
function(){ SPLASH || createSplash() })
|
function(){
|
||||||
|
SPLASH
|
||||||
|
|| createSplash() })
|
||||||
ipcMain.on('closeSplashScreen',
|
ipcMain.on('closeSplashScreen',
|
||||||
function(){
|
function(){
|
||||||
// force this to run after this frame avoiding races...
|
// force this to run after this frame avoiding races...
|
||||||
setTimeout(
|
setTimeout(
|
||||||
function(){ SPLASH && SPLASH.destroy() },
|
function(){
|
||||||
|
SPLASH
|
||||||
|
&& SPLASH.destroy() },
|
||||||
10) })
|
10) })
|
||||||
|
|
||||||
// DevTools...
|
// DevTools...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user