Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #267 and performance improvement #303

Merged
merged 1 commit into from
Feb 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions app/scripts/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,28 +871,24 @@ angular.module('icestudio')
};

this.newWindow = function(filepath, local) {
var execPath = process.execPath;
var command = [ coverPath(execPath) ];
if (execPath.endsWith('nw') || execPath.endsWith('nw.exe') || execPath.endsWith('nwjs Helper')) {
command.push(coverPath(nodePath.dirname(process.mainModule.filename)));
}
if (filepath) {
command.push(coverPath(filepath));
}
/*var win = window.get();
var position = {
x: win.x + 30,
y: win.y + 30
};
command.push(position.x + 'x' + position.y);*/
if (local) {
command.push('local');
}
nodeChildProcess.exec(command.join(' '), [], function(error/*, stdout/*, stderr*/) {
if (error) {
throw error;
}
});

var gui = require('nw.gui');

// Create a new window and get it
var new_win = gui.Window.open('index.html', {
"new_instance": true,
"position": "center",
"toolbar": false,
"width": 900,
"height": 600,
"show": true,
});

setTimeout(function (){
this.focus();

}.bind(new_win),250);

};

this.coverPath = coverPath;
Expand Down