Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-9.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Mar 25, 2024
2 parents ee9d024 + 066276f commit cbdafe7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
9 changes: 8 additions & 1 deletion themes/bootstrap3/js/check_item_statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,14 @@ VuFind.register('itemStatuses', function ItemStatuses() {
}

function checkAllItemStatuses(container = document) {
container.querySelectorAll(".ajaxItem").forEach(checkItemStatus);
const records = container.querySelectorAll(".ajaxItem");

if (records.length === 0) {
VuFind.emit("item-status-done");
return;
}

records.forEach(checkItemStatus);
}

function init($container = document) {
Expand Down
10 changes: 9 additions & 1 deletion themes/bootstrap3/js/check_save_statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,18 @@ VuFind.register("saveStatuses", function ItemStatuses() {

function checkAllSaveStatuses(container = document) {
if (!userIsLoggedIn) {
VuFind.emit("save-status-done");
return;
}

const records = container.querySelectorAll(".result,.record");

if (records.length === 0) {
VuFind.emit("save-status-done");
return;
}

container.querySelectorAll(".result,.record").forEach(checkSaveStatus);
records.forEach(checkSaveStatus);
}

function refresh() {
Expand Down
17 changes: 12 additions & 5 deletions themes/bootstrap3/js/trigger_print.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
/* global VuFind */

function waitForItemStatuses(fn) {
var itemDone = false;
var saveDone = false;
var itemDone = typeof VuFind.itemStatuses === "undefined";
var saveDone = typeof VuFind.saveStatuses === "undefined";
var fnCalled = false;

if (itemDone && saveDone) {
fn();
return;
}

function checkBoth() {
if (itemDone && saveDone) {
if (!fnCalled && itemDone && saveDone) {
fn();
fnCalled = true;
}
}

Expand All @@ -21,7 +28,7 @@ function waitForItemStatuses(fn) {
});
}

$(function triggerPrint() {
(function triggerPrint() {
if (!VuFind.isPrinting()) {
return;
}
Expand Down Expand Up @@ -60,4 +67,4 @@ $(function triggerPrint() {
// Make an ajax call to ensure that ajaxStop is triggered
$.getJSON(VuFind.path + '/AJAX/JSON', {method: 'keepAlive'});
});
});
})();

0 comments on commit cbdafe7

Please sign in to comment.