File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -281,10 +281,10 @@ <h2>Chase car mode</h2>
281281 < div id ="main " style ="display: none ">
282282 < div class ="scrollwrapper ">
283283 < div class ="portrait ">
284- < div class ="row vehicle0 "> < div class ="header empty "> < span > No vehicles :( </ span > </ div > </ div >
284+ < div class ="row vehicle0 "> < div class ="header empty "> < img style =" width:24px;height:24px " src =" img/hab-spinner.gif " / ></ div > </ div >
285285 </ div >
286286 < div class ="landscape ">
287- < div class ="row vehicle0 "> < div class ="header empty "> < span > No vehicles :( </ span > </ div > </ div >
287+ < div class ="row vehicle0 "> < div class ="header empty "> < img style =" width:24px;height:24px " src =" img/hab-spinner.gif " / ></ div > </ div >
288288 </ div >
289289 </ div >
290290 </ div >
Original file line number Diff line number Diff line change @@ -392,6 +392,13 @@ function load() {
392392 balloon_index = 0 ;
393393 stopFollow ( ) ;
394394
395+ // add loading spinner in the vehicle list
396+ $ ( '#main .empty' ) . parent ( ) . remove ( ) ;
397+ $ ( "#main .portrait,#main .landscape" ) . append (
398+ '<div class="row vehicle' + elm_uuid + '"><div class="header empty">' +
399+ '<img style="width:24px;height:24px" src="img/hab-spinner.gif"/></div></div>'
400+ ) ;
401+
395402 refresh ( ) ;
396403
397404 return true ;
@@ -2391,7 +2398,12 @@ function update(response) {
23912398 ! response . positions ||
23922399 ! response . positions . position ||
23932400 ! response . positions . position . length ) {
2401+
2402+ // if no vehicles are found, this will remove the spinner and put a friendly message
2403+ $ ( "#main .empty" ) . html ( "<span>No vehicles :(</span>" ) ;
2404+
23942405 ajax_inprogress = false ;
2406+
23952407 return ;
23962408 }
23972409
@@ -2455,6 +2467,7 @@ function update(response) {
24552467 setTimeout ( function ( ) { ctx . draw ( ctx ) ; } , 16 ) ;
24562468 } ,
24572469 end : function ( ctx ) {
2470+
24582471 // update graph is current vehicles is followed
24592472 if ( follow_vehicle !== null && vehicles [ follow_vehicle ] . graph_data_updated ) updateGraph ( follow_vehicle , false ) ;
24602473
You can’t perform that action at this time.
0 commit comments