Merge branch 'view_toggle_fix' into dev
This commit is contained in:
commit
a273f72246
|
|
@ -320,24 +320,15 @@ function initialize() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#grouptype_checkbox').on('click', function() {
|
$('#grouptype_checkbox').on('click', function() {
|
||||||
if ($('#grouptype_checkbox').hasClass('settingsCheckboxChecked')) {
|
toggleGroupByDataType(true);
|
||||||
sortByDistance();
|
});
|
||||||
} else {
|
|
||||||
sortByDataSource();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#altitude_checkbox').on('click', function() {
|
$('#altitude_checkbox').on('click', function() {
|
||||||
toggleAltitudeChart(true);
|
toggleAltitudeChart(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#selectall_checkbox').on('click', function() {
|
$('#selectall_checkbox').on('click', function() {
|
||||||
if ($('#selectall_checkbox').hasClass('settingsCheckboxChecked')) {
|
toggleAllPlanes(true);
|
||||||
deselectAllPlanes();
|
|
||||||
} else {
|
|
||||||
selectAllPlanes();
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Force map to redraw if sidebar container is resized - use a timer to debounce
|
// Force map to redraw if sidebar container is resized - use a timer to debounce
|
||||||
|
|
@ -350,6 +341,8 @@ function initialize() {
|
||||||
filterGroundVehicles(false);
|
filterGroundVehicles(false);
|
||||||
filterBlockedMLAT(false);
|
filterBlockedMLAT(false);
|
||||||
toggleAltitudeChart(false);
|
toggleAltitudeChart(false);
|
||||||
|
toggleAllPlanes(false);
|
||||||
|
toggleGroupByDataType(false);
|
||||||
|
|
||||||
// Get receiver metadata, reconfigure using it, then continue
|
// Get receiver metadata, reconfigure using it, then continue
|
||||||
// with initialization
|
// with initialization
|
||||||
|
|
@ -509,16 +502,21 @@ function initialize_map() {
|
||||||
CenterLon = Number(localStorage['CenterLon']) || DefaultCenterLon;
|
CenterLon = Number(localStorage['CenterLon']) || DefaultCenterLon;
|
||||||
ZoomLvl = Number(localStorage['ZoomLvl']) || DefaultZoomLvl;
|
ZoomLvl = Number(localStorage['ZoomLvl']) || DefaultZoomLvl;
|
||||||
MapType = localStorage['MapType'];
|
MapType = localStorage['MapType'];
|
||||||
|
var groupByDataTypeBox = localStorage.getItem('groupByDataType');
|
||||||
|
|
||||||
// Set SitePosition, initialize sorting
|
// Set SitePosition, initialize sorting
|
||||||
if (SiteShow && (typeof SiteLat !== 'undefined') && (typeof SiteLon !== 'undefined')) {
|
if (SiteShow && (typeof SiteLat !== 'undefined') && (typeof SiteLon !== 'undefined')) {
|
||||||
SitePosition = [SiteLon, SiteLat];
|
SitePosition = [SiteLon, SiteLat];
|
||||||
sortByDistance();
|
if (groupByDataTypeBox === 'deselected') {
|
||||||
|
sortByDistance();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SitePosition = null;
|
SitePosition = null;
|
||||||
PlaneRowTemplate.cells[9].style.display = 'none'; // hide distance column
|
PlaneRowTemplate.cells[9].style.display = 'none'; // hide distance column
|
||||||
document.getElementById("distance").style.display = 'none'; // hide distance header
|
document.getElementById("distance").style.display = 'none'; // hide distance header
|
||||||
sortByAltitude();
|
if (groupByDataTypeBox === 'deselected') {
|
||||||
|
sortByAltitude();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maybe hide flag info
|
// Maybe hide flag info
|
||||||
|
|
@ -1343,11 +1341,11 @@ function resortTable() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortBy(id,sc,se) {
|
function sortBy(id,sc,se) {
|
||||||
if (id !== 'data_source') {
|
if (id !== 'data_source') {
|
||||||
$('#grouptype_checkbox').removeClass('settingsCheckboxChecked');
|
$('#grouptype_checkbox').removeClass('settingsCheckboxChecked');
|
||||||
} else {
|
localStorage.setItem('groupByDataType', 'deselected');
|
||||||
$('#grouptype_checkbox').addClass('settingsCheckboxChecked');
|
}
|
||||||
}
|
|
||||||
if (id === sortId) {
|
if (id === sortId) {
|
||||||
sortAscending = !sortAscending;
|
sortAscending = !sortAscending;
|
||||||
PlanesOrdered.reverse(); // this correctly flips the order of rows that compare equal
|
PlanesOrdered.reverse(); // this correctly flips the order of rows that compare equal
|
||||||
|
|
@ -1466,6 +1464,45 @@ function selectNewPlanes() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleGroupByDataType(switchToggle) {
|
||||||
|
if (typeof localStorage['groupByDataType'] === 'undefined') {
|
||||||
|
localStorage.setItem('groupByDataType', 'deselected');
|
||||||
|
}
|
||||||
|
|
||||||
|
var groupByDataType = localStorage.getItem('groupByDataType');
|
||||||
|
if (switchToggle === true) {
|
||||||
|
groupByDataType = (groupByDataType === 'deselected') ? 'selected' : 'deselected';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (groupByDataType === 'deselected') {
|
||||||
|
$('#grouptype_checkbox').removeClass('settingsCheckboxChecked');
|
||||||
|
} else {
|
||||||
|
sortByDataSource();
|
||||||
|
$('#grouptype_checkbox').addClass('settingsCheckboxChecked');
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorage.setItem('groupByDataType', groupByDataType);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleAllPlanes(switchToggle) {
|
||||||
|
if (typeof localStorage['allPlanesSelection'] === 'undefined') {
|
||||||
|
localStorage.setItem('allPlanesSelection','deselected');
|
||||||
|
}
|
||||||
|
|
||||||
|
var allPlanesSelection = localStorage.getItem('allPlanesSelection');
|
||||||
|
if (switchToggle === true) {
|
||||||
|
allPlanesSelection = (allPlanesSelection === 'deselected') ? 'selected' : 'deselected';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (allPlanesSelection === 'deselected') {
|
||||||
|
deselectAllPlanes();
|
||||||
|
} else {
|
||||||
|
selectAllPlanes();
|
||||||
|
}
|
||||||
|
|
||||||
|
localStorage.setItem('allPlanesSelection', allPlanesSelection);
|
||||||
|
}
|
||||||
|
|
||||||
// deselect all the planes
|
// deselect all the planes
|
||||||
function deselectAllPlanes() {
|
function deselectAllPlanes() {
|
||||||
for(var key in Planes) {
|
for(var key in Planes) {
|
||||||
|
|
@ -1711,9 +1748,10 @@ function onFilterByAltitude(e) {
|
||||||
|
|
||||||
function filterGroundVehicles(switchFilter) {
|
function filterGroundVehicles(switchFilter) {
|
||||||
if (typeof localStorage['groundVehicleFilter'] === 'undefined') {
|
if (typeof localStorage['groundVehicleFilter'] === 'undefined') {
|
||||||
localStorage['groundVehicleFilter'] = 'not_filtered';
|
localStorage.setItem('groundVehicleFilter' , 'not_filtered');
|
||||||
}
|
}
|
||||||
var groundFilter = localStorage['groundVehicleFilter'];
|
|
||||||
|
var groundFilter = localStorage.getItem('groundVehicleFilter');
|
||||||
if (switchFilter === true) {
|
if (switchFilter === true) {
|
||||||
groundFilter = (groundFilter === 'not_filtered') ? 'filtered' : 'not_filtered';
|
groundFilter = (groundFilter === 'not_filtered') ? 'filtered' : 'not_filtered';
|
||||||
}
|
}
|
||||||
|
|
@ -1722,15 +1760,17 @@ function filterGroundVehicles(switchFilter) {
|
||||||
} else {
|
} else {
|
||||||
$('#groundvehicle_filter').removeClass('settingsCheckboxChecked');
|
$('#groundvehicle_filter').removeClass('settingsCheckboxChecked');
|
||||||
}
|
}
|
||||||
localStorage['groundVehicleFilter'] = groundFilter;
|
|
||||||
|
localStorage.setItem('groundVehicleFilter',groundFilter);
|
||||||
PlaneFilter.groundVehicles = groundFilter;
|
PlaneFilter.groundVehicles = groundFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterBlockedMLAT(switchFilter) {
|
function filterBlockedMLAT(switchFilter) {
|
||||||
if (typeof localStorage['blockedMLATFilter'] === 'undefined') {
|
if (typeof localStorage['blockedMLATFilter'] === 'undefined') {
|
||||||
localStorage['blockedMLATFilter'] = 'not_filtered';
|
localStorage.setItem('blockedMLATFilter','not_filtered');
|
||||||
}
|
}
|
||||||
var blockedMLATFilter = localStorage['blockedMLATFilter'];
|
|
||||||
|
var blockedMLATFilter = localStorage.getItem('blockedMLATFilter');
|
||||||
if (switchFilter === true) {
|
if (switchFilter === true) {
|
||||||
blockedMLATFilter = (blockedMLATFilter === 'not_filtered') ? 'filtered' : 'not_filtered';
|
blockedMLATFilter = (blockedMLATFilter === 'not_filtered') ? 'filtered' : 'not_filtered';
|
||||||
}
|
}
|
||||||
|
|
@ -1739,24 +1779,27 @@ function filterBlockedMLAT(switchFilter) {
|
||||||
} else {
|
} else {
|
||||||
$('#blockedmlat_filter').removeClass('settingsCheckboxChecked');
|
$('#blockedmlat_filter').removeClass('settingsCheckboxChecked');
|
||||||
}
|
}
|
||||||
localStorage['blockedMLATFilter'] = blockedMLATFilter;
|
localStorage.setItem('blockedMLATFilter', blockedMLATFilter);
|
||||||
PlaneFilter.blockedMLAT = blockedMLATFilter;
|
PlaneFilter.blockedMLAT = blockedMLATFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleAltitudeChart(switchToggle) {
|
function toggleAltitudeChart(switchToggle) {
|
||||||
if (typeof localStorage['altitudeChart'] === 'undefined') {
|
if (typeof localStorage['altitudeChart'] === 'undefined') {
|
||||||
localStorage['altitudeChart'] = 'show';
|
localStorage.setItem('altitudeChart','show');
|
||||||
}
|
}
|
||||||
var altitudeChartDisplay = localStorage['altitudeChart'];
|
|
||||||
|
var altitudeChartDisplay = localStorage.getItem('altitudeChart');
|
||||||
if (switchToggle === true) {
|
if (switchToggle === true) {
|
||||||
altitudeChartDisplay = (altitudeChartDisplay === 'show') ? 'hidden' : 'show';
|
altitudeChartDisplay = (altitudeChartDisplay === 'show') ? 'hidden' : 'show';
|
||||||
}
|
}
|
||||||
// if you're using custom colors always hide the chart
|
|
||||||
if (customAltitudeColors === true) {
|
// if you're using custom colors always hide the chart
|
||||||
altitudeChartDisplay = 'hidden';
|
if (customAltitudeColors === true) {
|
||||||
// also hide the control option
|
altitudeChartDisplay = 'hidden';
|
||||||
$('#altitude_chart_container').hide();
|
// also hide the control option
|
||||||
}
|
$('#altitude_chart_container').hide();
|
||||||
|
}
|
||||||
|
|
||||||
if (altitudeChartDisplay === 'show') {
|
if (altitudeChartDisplay === 'show') {
|
||||||
$('#altitude_checkbox').addClass('settingsCheckboxChecked');
|
$('#altitude_checkbox').addClass('settingsCheckboxChecked');
|
||||||
$('#altitude_chart').show();
|
$('#altitude_chart').show();
|
||||||
|
|
@ -1764,7 +1807,8 @@ function toggleAltitudeChart(switchToggle) {
|
||||||
$('#altitude_checkbox').removeClass('settingsCheckboxChecked');
|
$('#altitude_checkbox').removeClass('settingsCheckboxChecked');
|
||||||
$('#altitude_chart').hide();
|
$('#altitude_chart').hide();
|
||||||
}
|
}
|
||||||
localStorage['altitudeChart'] = altitudeChartDisplay;
|
|
||||||
|
localStorage.setItem('altitudeChart', altitudeChartDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onResetAltitudeFilter(e) {
|
function onResetAltitudeFilter(e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue