Skip to content

Commit 8f15c8c

Browse files
committed
Don't require a Component Unique Identifier to display barcode
1 parent c2ae711 commit 8f15c8c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/assets/getty_barcode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(function(exports) {
22
$(document).on("loadedrecordform.aspace", function(event, $pane) {
3-
const name = $('label[for=archival_object_component_id_]').parent().find('div').text();
3+
const name = $('label[for=archival_object_component_id_]').parent().find('div').text() || document.location.hash.split('::')[1];
44
const data = $('label[for=archival_object_ref_id_]').parent().find('.identifier-display').text();
55

6-
if (name && data) {
6+
if (data) {
77
const url = AS.app_prefix('/plugins/getty_barcode?data=' + data + '&name=barcode_' + name);
88
const bbut = '<a id="getty-barcode-button" class="btn btn-sm btn-default" href="' + url + '">Barcode</a>';
99
$('.record-toolbar > .btn-toolbar > .btn-group').prepend(bbut);

0 commit comments

Comments
 (0)