File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed
Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -58,8 +58,6 @@ function lhash_update(history_step) {
5858 } else {
5959 document . location . hash = "!" + hash ;
6060 }
61-
62- console . log ( "hash:" , hash ) ;
6361}
6462
6563// wvar detection
@@ -402,7 +400,9 @@ var positionUpdateHandle = function(position) {
402400 $ ( '#cc_timestamp' ) . text ( 'just now' ) ;
403401
404402 // update look angles once we get position
405- if ( follow_vehicle !== null ) { update_lookangles ( follow_vehicle ) ; }
403+ if ( follow_vehicle !== null && vehicles [ follow_vehicle ] !== undefined ) {
404+ update_lookangles ( follow_vehicle ) ;
405+ }
406406
407407 if ( CHASE_enabled ) {
408408 ChaseCar . updatePosition ( callsign , position ) ;
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ function clean_refresh(text, force) {
351351
352352 car_index = 0 ;
353353 balloon_index = 0 ;
354- if ( ! force ) stopFollow ( ) ;
354+ stopFollow ( force ) ;
355355
356356 // add loading spinner in the vehicle list
357357 $ ( '#main .empty' ) . parent ( ) . remove ( ) ;
@@ -698,17 +698,21 @@ function focusVehicle(vcallsign, ignoreOpt) {
698698 }
699699}
700700
701- function stopFollow ( ) {
701+ function stopFollow ( no_data_reset ) {
702+ no_data_reset = ! ! no_data_reset ;
703+
702704 if ( follow_vehicle !== null ) {
703- focusVehicle ( null ) ;
705+ if ( ! no_data_reset ) {
706+ focusVehicle ( null ) ;
704707
705- // remove target mark
706- $ ( "#main .row.follow" ) . removeClass ( "follow" ) ;
708+ // remove target mark
709+ $ ( "#main .row.follow" ) . removeClass ( "follow" ) ;
707710
708- if ( follow_vehicle in vehicles ) vehicles [ follow_vehicle ] . follow = false ;
709- follow_vehicle = null ;
710- graph_vehicle = null ;
711- wvar . focus = "" ;
711+ if ( follow_vehicle in vehicles ) vehicles [ follow_vehicle ] . follow = false ;
712+ follow_vehicle = null ;
713+ graph_vehicle = null ;
714+ wvar . focus = "" ;
715+ }
712716
713717 // clear graph
714718 if ( plot ) plot = $ . plot ( plot_holder , { } , plot_options ) ;
@@ -2299,8 +2303,6 @@ function habitat_step(remove_current) {
22992303 url += habitat_step_data . payloads [ habitat_step_data . idx ] . skip ;
23002304 habitat_step_data . payloads [ habitat_step_data . idx ] . skip += habitat_max ;
23012305
2302- console . log ( url ) ;
2303-
23042306 ajax_positions = $ . getJSON ( url , function ( response ) {
23052307 habitat_translation_layer ( response ) ;
23062308 } ) ;
You can’t perform that action at this time.
0 commit comments