fixup navbarreloader wrt auth_hash

This commit is contained in:
Isaac Connor 2018-02-14 13:16:14 -05:00
parent 002f22f685
commit 4c1abf93ba
1 changed files with 11 additions and 6 deletions

View File

@ -182,22 +182,27 @@ function refreshParentWindow() {
} }
} }
if (currentView !='none') { if ( currentView != 'none' ) {
$j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON. $j.ajaxSetup ({timeout: AJAX_TIMEOUT }); //sets timeout for all getJSON.
$j(document).ready(function() { $j(document).ready(function() {
if ($j('.navbar').length) setInterval(getNavBar, navBarRefresh) if ($j('.navbar').length) {
setInterval(getNavBar, navBarRefresh);
}
}); });
function getNavBar () { function getNavBar() {
$j.getJSON(thisUrl + '?view=request&request=status&entity=navBar', setNavBar); $j.getJSON(thisUrl + '?view=request&request=status&entity=navBar', setNavBar);
} }
function setNavBar (data) { function setNavBar(data) {
console.log(data);
if ( data.auth ) { if ( data.auth ) {
if ( data.auth != auth_hash ) {
// Update authentication token. // Update authentication token.
auth_hash = data.auth; auth_hash = data.auth;
} }
}
$j('#reload').replaceWith(data.message); $j('#reload').replaceWith(data.message);
} }
} }