Skip to content

Commit

Permalink
Fixes #10 - again
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsbfft committed Jun 30, 2016
1 parent 8533020 commit c8460d6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/js/main/Oryoki.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Oryoki() {

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

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

this.windowsIndex++;
this.windowCount++;

// @if NODE_ENV='development'
c.log('[Oryoki] Currently', this.windowCount, 'windows open');
// @endif

if(this.windowCount == 1) {
if(this.windowCount == 0) {
// No window open -> create a centered window
this.windows[this.windowsIndex] = new Window({
'id' : this.windowsIndex,
Expand All @@ -82,6 +75,13 @@ Oryoki.prototype.createWindow = function(e, url) {
});
}

this.windowsIndex++;
this.windowCount++;

// @if NODE_ENV='development'
c.log('[Oryoki] Currently', this.windowCount, 'windows open');
// @endif

}

Oryoki.prototype.onFocusChange = function(w) {
Expand Down

0 comments on commit c8460d6

Please sign in to comment.