File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -385,8 +385,6 @@ $(window).ready(function() {
385385 $ ( '#main' ) . on ( 'click' , '.row .data' , function ( ) {
386386 var e = $ ( this ) . parent ( ) ;
387387 followVehicle ( parseInt ( e . attr ( 'class' ) . match ( / v e h i c l e ( \d + ) / ) [ 1 ] ) ) ;
388- $ ( '#main .row.follow' ) . removeClass ( 'follow' ) ;
389- e . addClass ( 'follow' ) ;
390388 } ) ;
391389
392390 // expand/collapse data when header is clicked
@@ -402,7 +400,6 @@ $(window).ready(function() {
402400 // disable following only we are collapsing the followed vehicle
403401 if ( follow_vehicle == parseInt ( e . attr ( 'class' ) . match ( / v e h i c l e ( \d + ) / ) [ 1 ] ) ) {
404402 stopFollow ( ) ;
405- e . removeClass ( 'follow' ) ;
406403 }
407404 } else {
408405 // expand data for selected vehicle
@@ -419,8 +416,6 @@ $(window).ready(function() {
419416
420417 // pan to selected vehicle
421418 followVehicle ( parseInt ( e . attr ( 'class' ) . match ( / v e h i c l e ( \d + ) / ) [ 1 ] ) ) ;
422- $ ( '#main .row.follow' ) . removeClass ( 'follow' ) ;
423- e . addClass ( 'follow' ) ;
424419 }
425420 } ) ;
426421
Original file line number Diff line number Diff line change @@ -369,6 +369,9 @@ function updateZoom() {
369369
370370function stopFollow ( ) {
371371 if ( follow_vehicle != - 1 ) {
372+ // remove target mark
373+ $ ( "#main .row.follow" ) . removeClass ( "follow" ) ;
374+
372375 vehicles [ follow_vehicle ] . follow = false ;
373376 follow_vehicle = - 1 ;
374377
@@ -387,6 +390,11 @@ function followVehicle(index) {
387390 if ( follow_vehicle != index ) {
388391 follow_vehicle = index ;
389392 vehicles [ follow_vehicle ] . follow = true ;
393+
394+ // add target mark
395+ $ ( "#main .row.follow" ) . removeClass ( "follow" ) ;
396+ $ ( "#main .vehicle" + follow_vehicle ) . addClass ( "follow" ) ;
397+
390398 updateGraph ( index , true ) ;
391399 }
392400
You can’t perform that action at this time.
0 commit comments