mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
29 lines
782 B
JavaScript
29 lines
782 B
JavaScript
function locationcontentsheetView(Grocy, scope = null)
|
|
{
|
|
var $scope = $;
|
|
var top = scope != null ? $(scope) : $(document);
|
|
if (scope != null)
|
|
{
|
|
$scope = (selector) => $(scope).find(selector);
|
|
}
|
|
|
|
top.on("click", ".print-all-locations-button", function(e)
|
|
{
|
|
$scope(".page").removeClass("d-print-none").removeClass("no-page-break");
|
|
$scope(".print-timestamp").text(moment().format("l LT"));
|
|
window.print();
|
|
});
|
|
|
|
top.on("click", ".print-single-location-button", function(e)
|
|
{
|
|
$scope(".page").addClass("d-print-none");
|
|
$scope(e.currentTarget).closest(".page").removeClass("d-print-none").addClass("no-page-break");
|
|
$scope(".print-timestamp").text(moment().format("l LT"));
|
|
window.print();
|
|
});
|
|
|
|
}
|
|
|
|
|
|
window.locationcontentsheetView = locationcontentsheetView
|