@@ -432,19 +432,21 @@ ExecutionVisualizer.prototype.render = function() {
432432ExecutionVisualizer . prototype . enterViewAnnotationsMode = function ( ) {
433433 this . editAnnotationMode = false ;
434434
435- // TODO: grab all annotations bubbles from current trace entry
436- /*
435+ // TODO: check for memory leaks!!!
436+ var myViz = this ;
437+
437438 $ . each ( myViz . allAnnotationBubbles , function ( i , e ) {
438439 e . enterViewMode ( ) ;
439440 } ) ;
440- */
441+
442+ // TODO: "save" annotations into the trace as direct mappings of
443+ // id -> annotation text
441444}
442445
443446ExecutionVisualizer . prototype . enterEditAnnotationsMode = function ( ) {
444- // TODO: check for memory leaks!!!
445-
446447 this . editAnnotationMode = true ;
447448
449+ // TODO: check for memory leaks!!!
448450 var myViz = this ;
449451
450452 var codelineIDs = [ ] ;
@@ -468,36 +470,34 @@ ExecutionVisualizer.prototype.enterEditAnnotationsMode = function() {
468470 } ) ;
469471
470472
471- var allAnnotationBubbles = [ ] ;
473+ myViz . allAnnotationBubbles = [ ] ;
472474
473475 $ . each ( codelineIDs , function ( i , e ) {
474- allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'codeline' , e ) ) ;
476+ myViz . allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'codeline' , e ) ) ;
475477 } ) ;
476478
477479 $ . each ( heapObjectIDs , function ( i , e ) {
478- allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'object' , e ) ) ;
480+ myViz . allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'object' , e ) ) ;
479481 } ) ;
480482
481483 $ . each ( variableIDs , function ( i , e ) {
482- allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'variable' , e ) ) ;
484+ myViz . allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'variable' , e ) ) ;
483485 } ) ;
484486
485487 $ . each ( frameIDs , function ( i , e ) {
486- allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'frame' , e ) ) ;
488+ myViz . allAnnotationBubbles . push ( new AnnotationBubble ( myViz , 'frame' , e ) ) ;
487489 } ) ;
488490
489- //this.allAnnotationBubbles = allAnnotationBubbles;
490-
491491 // TODO: this is badly placed ...
492492 this . domRoot . find ( '#pyCodeOutputDiv' ) . scroll ( function ( ) {
493- $ . each ( allAnnotationBubbles , function ( i , e ) {
493+ $ . each ( myViz . allAnnotationBubbles , function ( i , e ) {
494494 if ( e . type == 'codeline' ) {
495495 e . redrawCodelineBubble ( ) ;
496496 }
497497 } ) ;
498498 } ) ;
499499
500- $ . each ( allAnnotationBubbles , function ( i , e ) {
500+ $ . each ( myViz . allAnnotationBubbles , function ( i , e ) {
501501 e . enterEditMode ( ) ;
502502 } ) ;
503503}
0 commit comments