kopia lustrzana https://github.com/cyoung/stratux
Merge branch 'webimprovements'
commit
56d1e9d468
|
@ -1,3 +1,4 @@
|
|||
<div ui-content-for="title">Developer</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel-group col-sm-6">
|
||||
<div class="panel panel-default">
|
||||
|
|
|
@ -45,6 +45,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
};
|
||||
|
||||
socket.onmessage = function (msg) {
|
||||
if ($scope === undefined || $scope === null) {
|
||||
socket.close();
|
||||
return;
|
||||
}
|
||||
|
||||
loadSituation(msg.data);
|
||||
$scope.$apply(); // trigger any needed refreshing of data
|
||||
};
|
||||
|
@ -61,7 +66,11 @@ function GPSCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
|
||||
function sizeMap() {
|
||||
var width = 0;
|
||||
var el = document.getElementById("map_display").parentElement;
|
||||
var div = document.getElementById("map_display");
|
||||
if (div==null) {
|
||||
return width;
|
||||
}
|
||||
var el = div.parentElement;
|
||||
width = el.offsetWidth; // was (- (2 * el.offsetLeft))
|
||||
if (width !== display_area_size) {
|
||||
display_area_size = width;
|
||||
|
|
|
@ -210,6 +210,10 @@ function StatusCtrl($rootScope, $scope, $state, $http, $interval, craftService)
|
|||
};
|
||||
|
||||
function getTowers() {
|
||||
// Homepage status polling towers only if they are active
|
||||
if ($scope.visible_uat===undefined || $scope.visible_uat==false) {
|
||||
return;
|
||||
}
|
||||
// Simple GET request example (note: responce is asynchronous)
|
||||
$http.get(URL_TOWERS_GET).
|
||||
then(function (response) {
|
||||
|
|
|
@ -258,6 +258,7 @@ function TrafficCtrl($rootScope, $scope, $state, $http, $interval, craftService)
|
|||
}
|
||||
// stop stale traffic cleanup
|
||||
$interval.cancel(clearStaleTraffic);
|
||||
$interval.cancel(getClock);
|
||||
};
|
||||
|
||||
// Traffic Controller tasks
|
||||
|
|
Ładowanie…
Reference in New Issue