mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-08 02:12:17 -04:00
Merge pull request #4955 from IgorA100/patch-622555
Fix: Display the log page refresh status as "stopped" only while processing selected lines, not when a new request occurs on Log page
This commit is contained in:
1 file changed
+6
-1
@@ -40,7 +40,6 @@ function ajaxRequest(params) {
|
||||
// We won't automatically refresh to avoid disturbing the user who has selected rows.
|
||||
console.debug("The user selected rows in the table, and the AJAX request was rejected.");
|
||||
requestMissed = true;
|
||||
updateHeaderRequestStatus("stopped");
|
||||
return;
|
||||
}
|
||||
if (ajax && (ajax.readyState !== 4 && ajax.readyState !== 0)) {
|
||||
@@ -423,10 +422,12 @@ function manageClearButtonAvailability(enable = null) {
|
||||
|
||||
if (selections.length) {
|
||||
allowRequest = false; // We'll prevent table updates from interfering with the user who has selected rows.
|
||||
updateHeaderRequestStatus("stopped");
|
||||
if (ajax && (ajax.readyState !== 4 && ajax.readyState !== 0)) {
|
||||
ajax.abort("plannedAbort"); // There may already be a previous request that hasn't completed.
|
||||
}
|
||||
} else {
|
||||
if (readHeaderRequestStatus() === "stopped") updateHeaderRequestStatus("awaiting");
|
||||
if (requestMissed === true) {
|
||||
// A scheduled AJAX update was missed. We'll execute it out of order.
|
||||
allowRequest = true;
|
||||
@@ -438,6 +439,10 @@ function manageClearButtonAvailability(enable = null) {
|
||||
}
|
||||
}
|
||||
|
||||
function readHeaderRequestStatus() {
|
||||
return $j('#requestStatus').text().replace(/(\[|\])/g, '').trim();
|
||||
}
|
||||
|
||||
function updateHeaderRequestStatus(text) {
|
||||
$j('#requestStatus').text(" ["+text+"]");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user