File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ manager.reallyRemove = function(id){
116116 }
117117 current_file = "" ;
118118 if ( id !== "welcome" ) {
119- if ( settings . state . tabs . indexOf ( id ) !== - 1 ) {
120- settings . state . tabs . splice ( settings . state . tabs . indexOf ( id ) , 1 ) ;
119+ if ( settings . state . tabs . indexOf ( cloud_use + "_" + id ) !== - 1 ) {
120+ settings . state . tabs . splice ( settings . state . tabs . indexOf ( cloud_use + "_" + id ) , 1 ) ;
121121 settings . change ( ) ;
122122 }
123123 }
@@ -457,17 +457,15 @@ settings.init = function(){
457457
458458settings . initTabs = function ( ) {
459459 for ( var i = 0 ; i < settings . state . tabs . length ; i ++ ) {
460- if ( settings . state . tabs [ i ] . indexOf ( cloud_use ) === 0 && manager . isOpen ( settings . state . tabs [ i ] ) === false ) {
461- addTab ( settings . state . tabs [ i ] . replace ( cloud_use + "_" , "" ) , false ) ;
460+ if ( settings . state . tabs [ i ] . indexOf ( cloud_use ) === 0 && manager . isOpen ( settings . state . tabs [ i ] . replace ( ( cloud_use + "_" ) , "" ) ) === false ) {
461+ console . log ( cloud_use + "_" ) ;
462+ addTab ( settings . state . tabs [ i ] . replace ( ( cloud_use + "_" ) , "" ) , false ) ;
462463 }
463464 }
464465}
465466
466467settings . change = function ( ) {
467468 var info = settings . state ;
468- for ( var i = 0 ; i < info . tabs . length ; i ++ ) {
469- info . tabs [ i ] = cloud_use + "_" + info . tabs [ i ] ;
470- }
471469 $ . ajax ( "https://codeyourcloud.com/prefs/change" , {
472470 method : "POST" ,
473471 data : info ,
Original file line number Diff line number Diff line change @@ -116,8 +116,8 @@ function addTab(id, welcome){
116116 }
117117 else {
118118 //add a tab
119- if ( id !== "welcome" && settings . state . tabs . indexOf ( id ) === - 1 ) {
120- settings . state . tabs . push ( id ) ;
119+ if ( id !== "welcome" && settings . state . tabs . indexOf ( cloud_use + "_" + id ) === - 1 ) {
120+ settings . state . tabs . push ( cloud_use + "_" + id ) ;
121121 settings . change ( ) ;
122122 }
123123
You can’t perform that action at this time.
0 commit comments