@@ -431,15 +431,19 @@ MM.Item.prototype.mergeWith = function(data) {
431
431
/* FIXME children - co kdyz je nekdo z nas zrovna aktivni, nerkuli editovatelny? */
432
432
( data . children || [ ] ) . forEach ( function ( child , index ) {
433
433
if ( index >= this . _children . length ) { /* new child */
434
+ console . log ( "adding new child" , child , "at" , index ) ;
434
435
this . insertChild ( MM . Item . fromJSON ( child ) ) ;
435
- dirty = true ;
436
+ // dirty = true; FIXME to zaridi to dite, ze?
436
437
} else { /* existing child */
437
438
var myChild = this . _children [ index ] ;
438
439
if ( myChild . getId ( ) == child . id ) { /* recursive merge */
440
+ console . log ( "merging child" , myChild , "with" , child ) ;
439
441
myChild . mergeWith ( child ) ;
440
442
} else { /* changed; replace */
441
- this . _children [ index ] = MM . Item . fromJSON ( child ) ;
442
- dirty = true ;
443
+ console . log ( "replacing dead child" , myChild , "with new" , child ) ;
444
+ this . removeChild ( this . _children [ index ] ) ;
445
+ this . insertChild ( MM . Item . fromJSON ( child ) , index ) ;
446
+ // dirty = true; FIXME to zaridi to dite, ze?
443
447
}
444
448
}
445
449
} , this ) ;
@@ -4346,7 +4350,7 @@ MM.UI.Backend.Firebase.load = function() {
4346
4350
4347
4351
MM . UI . Backend . Firebase . _load = function ( id ) {
4348
4352
MM . App . setThrobber ( true ) ;
4349
-
4353
+ /* FIXME posere se kdyz zmenim jeden firebase na jiny */
4350
4354
this . _backend . load ( id ) . then (
4351
4355
this . _loadDone . bind ( this ) ,
4352
4356
this . _error . bind ( this )
0 commit comments