4,656
edits
No edit summary |
No edit summary |
||
| Line 1,862: | Line 1,862: | ||
// toggle filtered print options | // toggle filtered print options | ||
jQuery(document).on("click", ".print-selection-toggle", function (e) { | jQuery(document).on("click", ".print-selection-toggle", function (e) { | ||
e.preventDefault(); | |||
jQuery("#print-selection-options").toggle(); | |||
}); | |||
// run filtered batch print | |||
jQuery(document).on( | |||
"click", | "click", | ||
".print-selection-border, .print-selection-no-border", | ".print-selection-border, .print-selection-no-border", | ||
function (e) { | function (e) { | ||
e.preventDefault(); | |||
var $btn = jQuery(this); | |||
var borderPref = $btn.hasClass("print-selection-no-border") | |||
? "without" | ? "without" | ||
: "with"; | : "with"; | ||
// 👇 UI feedback | |||
var originalText = $btn.text(); | |||
$btn.text("[PREPARING]"); | |||
$btn.prop("disabled", true); | |||
hidePrintSelectionOptions(); | |||
// 👇 allow UI to update before heavy print logic | |||
setTimeout(function () { | |||
swHandleBatchPrint(borderPref); | |||
// optional reset (in case user comes back) | |||
$btn.text(originalText); | |||
$btn.prop("disabled", false); | |||
}, 50); | |||
} | } | ||
); | ); | ||