fixup navbarreloader wrt auth_hash
This commit is contained in:
parent
002f22f685
commit
4c1abf93ba
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue