diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000000..0ca7ada960 Binary files /dev/null and b/images/loading.gif differ diff --git a/main.html b/main.html index 05628ff1b8..a44c5c9a05 100644 --- a/main.html +++ b/main.html @@ -18,6 +18,7 @@ + diff --git a/main.js b/main.js index b400078ba3..d3a8b59eec 100644 --- a/main.js +++ b/main.js @@ -72,40 +72,42 @@ $(document).ready(function() { // detach listeners and remove element data $('#content').empty(); - switch (tab) { - case 'tab_initial_setup': - tabs.initial_setup.initialize(); - break; - case 'tab_pid_tuning': - tabs.pid_tuning.initialize(); - break; - case 'tab_receiver': - tabs.receiver.initialize(); - break; - case 'tab_auxiliary_configuration': - tabs.auxiliary_configuration.initialize(); - break; - case 'tab_servos': - tabs.servos.initialize(); - break; - case 'tab_gps': - tabs.gps.initialize(); - break; - case 'tab_motor_outputs': - tabs.motor_outputs.initialize(); - break; - case 'tab_sensors': - tabs.sensors.initialize(); - break; - case 'tab_cli': - tabs.cli.initialize(); - break; - case 'tab_logging': - tabs.logging.initialize(); - break; - } + $('#content').load("./tabs/loading.html", function() { + switch (tab) { + case 'tab_initial_setup': + tabs.initial_setup.initialize(); + break; + case 'tab_pid_tuning': + tabs.pid_tuning.initialize(); + break; + case 'tab_receiver': + tabs.receiver.initialize(); + break; + case 'tab_auxiliary_configuration': + tabs.auxiliary_configuration.initialize(); + break; + case 'tab_servos': + tabs.servos.initialize(); + break; + case 'tab_gps': + tabs.gps.initialize(); + break; + case 'tab_motor_outputs': + tabs.motor_outputs.initialize(); + break; + case 'tab_sensors': + tabs.sensors.initialize(); + break; + case 'tab_cli': + tabs.cli.initialize(); + break; + case 'tab_logging': + tabs.logging.initialize(); + break; + } - GUI.tab_switch_in_progress = false; + GUI.tab_switch_in_progress = false; + }); }); } }); diff --git a/tabs/loading.css b/tabs/loading.css new file mode 100644 index 0000000000..2f9d3b42ed --- /dev/null +++ b/tabs/loading.css @@ -0,0 +1,16 @@ +.tab-loading { + width: 100%; + height: 100%; + + background-image: url('../images/loading.gif'); + background-repeat: no-repeat; + background-position: center; +} + +.tab-loading p { + position: relative; + top: calc(50% + 50px); + + text-align: center; + font-weight: bold; +} \ No newline at end of file diff --git a/tabs/loading.html b/tabs/loading.html new file mode 100644 index 0000000000..10ada189e8 --- /dev/null +++ b/tabs/loading.html @@ -0,0 +1,3 @@ +
+

Waiting for data ...

+
\ No newline at end of file