Setting device id and type to page title

revert-dabc3590
Dunith Dhanushka 8 years ago committed by GitHub
parent 2639c90e50
commit c1de144bcf

@ -41,10 +41,24 @@ function initialLoad() {
processAfterInitializationMap();
//Access gps and make zoom to server location as map center
//navigator.geolocation.getCurrentPosition(success, error);
setPageTitle();
$("#loading").hide();
}
}
function setPageTitle() {
var hash = window.parent.location.hash;
if(hash) {
var startIdx = hash.indexOf("/") + 1;
var lastIdx = hash.length;
var deviceInfoString = hash.substring(startIdx,lastIdx);
var deviceInfo = JSON.parse(deviceInfoString);
if(deviceInfo) {
var newTitle = " Geo Dashboard - Device ID: " + deviceInfo.device.id + " Type: " + deviceInfo.device.type;
window.parent.document.title = newTitle;
}
}
}
//function success(position) {
// var browserLatitude = position.coords.latitude;

Loading…
Cancel
Save