open file sequence fix

This commit is contained in:
Antelle 2015-10-25 10:53:05 +03:00
parent 07dbbf45bf
commit 6ff54a2ee1
1 changed files with 3 additions and 1 deletions

View File

@ -36,13 +36,15 @@ app.on('ready', function() {
});
app.on('open-file', function(e, path) {
e.preventDefault();
openFile = path.replace(/"/g, '\\"').replace(/\\/g, '\\\\');
openFile = path;
notifyOpenFile();
});
function notifyOpenFile() {
if (ready && openFile && mainWindow) {
openFile = openFile.replace(/"/g, '\\"').replace(/\\/g, '\\\\');
mainWindow.webContents.executeJavaScript('if (window.launcherOpen) { window.launcherOpen("' + openFile + '"); } ' +
' else { window.launcherOpenedFile="' + openFile + '"; }');
openFile = null;
}
}