Updates sorting to display records in the order they were user/abowling/lp1845556_spine_label_enhanced_printing_final
authorAdam Bowling <abowling@emeralddata.net>
Fri, 6 Aug 2021 18:33:01 +0000 (14:33 -0400)
committerAdam Bowling <abowling@emeralddata.net>
Fri, 6 Aug 2021 18:33:01 +0000 (14:33 -0400)
submitted to the page.

Signed-off-by: Adam Bowling <abowling@emeralddata.net>
Open-ILS/web/js/ui/default/staff/cat/printlabels/app.js

index 6c57b78..e8803e0 100644 (file)
@@ -290,6 +290,7 @@ function ($scope, $q, $window, $routeParams, $location, $timeout, egCore, egNet,
 
                     $q.all(promises2).then(function () {
                         // today, staff, current_location, etc.
+                        $scope.preview_scope.copies.sort((a, b) => (data.copies.indexOf(a.id) > data.copies.indexOf(b.id)) ? 1 : ((data.copies.indexOf(b.id) > data.copies.indexOf(a.id)) ? -1 : 0));
                         egCore.print.fleshPrintScope($scope.preview_scope);
                         $scope.template_changed(); // load the default
                         $scope.rebuild_cn_set();
@@ -927,4 +928,4 @@ function getPrintLabelOutputClass(index, settings) {
 
 function getPrintLabelStyle(index, settings) {
     return index > 0 && (index % settings.page.label.set.size === 0) ? settings.page.label.gap.size : "";
-}
\ No newline at end of file
+}