mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
fixed electron closing without saving settings...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1ff105bcfc
commit
45a3b937be
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
var cfg = {
|
var requirejs_cfg = {
|
||||||
// XXX this does not work on direct filesystem access...
|
// XXX this does not work on direct filesystem access...
|
||||||
//urlArgs: 'bust='+Date.now(),
|
//urlArgs: 'bust='+Date.now(),
|
||||||
|
|
||||||
@ -37,17 +37,18 @@ var cfg = {
|
|||||||
|
|
||||||
|
|
||||||
if(typeof(require) != 'undefined'){
|
if(typeof(require) != 'undefined'){
|
||||||
cfg.nodeRequire = require
|
requirejs_cfg.nodeRequire = require
|
||||||
//cfg.baseUrl = __dirname
|
//requirejs_cfg.baseUrl = __dirname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// XXX revise...
|
||||||
if(typeof(require) != 'undefined' && typeof(global) != 'undefined'){
|
if(typeof(require) != 'undefined' && typeof(global) != 'undefined'){
|
||||||
global.requirejs = global.requirejs || require('requirejs')
|
global.requirejs = global.requirejs || require('requirejs')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
requirejs.config(cfg)
|
requirejs.config(requirejs_cfg)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -375,6 +375,10 @@ var LifeCycleActions = actions.Actions({
|
|||||||
nw.Window.get().on('close', this.__nw_stop_handler)
|
nw.Window.get().on('close', this.__nw_stop_handler)
|
||||||
|
|
||||||
|
|
||||||
|
// electron...
|
||||||
|
} else if(runtime.electron){
|
||||||
|
$(window).on('beforeunload', stop)
|
||||||
|
|
||||||
// node...
|
// node...
|
||||||
} else if(runtime.node){
|
} else if(runtime.node){
|
||||||
process.on('exit', stop)
|
process.on('exit', stop)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user