Skip to content

Commit c8460d6

Browse files
committed
Fixes #10 - again
1 parent 8533020 commit c8460d6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/js/main/Oryoki.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function Oryoki() {
1919

2020
this.windows = [];
2121
this.focusedWindow = null;
22-
this.windowsIndex = -1; // Index to make sure we assign unique Ids
22+
this.windowsIndex = 0; // Index to make sure we assign unique Ids
2323
this.windowCount = 0; // Counts the number of windows currently open
2424

2525
this.attachEvents();
@@ -53,14 +53,7 @@ Oryoki.prototype.createWindow = function(e, url) {
5353
c.log('[Oryoki] Creating new window');
5454
// @endif
5555

56-
this.windowsIndex++;
57-
this.windowCount++;
58-
59-
// @if NODE_ENV='development'
60-
c.log('[Oryoki] Currently', this.windowCount, 'windows open');
61-
// @endif
62-
63-
if(this.windowCount == 1) {
56+
if(this.windowCount == 0) {
6457
// No window open -> create a centered window
6558
this.windows[this.windowsIndex] = new Window({
6659
'id' : this.windowsIndex,
@@ -82,6 +75,13 @@ Oryoki.prototype.createWindow = function(e, url) {
8275
});
8376
}
8477

78+
this.windowsIndex++;
79+
this.windowCount++;
80+
81+
// @if NODE_ENV='development'
82+
c.log('[Oryoki] Currently', this.windowCount, 'windows open');
83+
// @endif
84+
8585
}
8686

8787
Oryoki.prototype.onFocusChange = function(w) {

0 commit comments

Comments
 (0)