File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff 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
8787Oryoki . prototype . onFocusChange = function ( w ) {
You can’t perform that action at this time.
0 commit comments