From 73241e87bb803cf31c4ba34883c98951f7dff021 Mon Sep 17 00:00:00 2001
From: Martin Artnik
Date: Tue, 31 Aug 2021 14:37:02 +0200
Subject: [PATCH] Fix barcode scanning in modals [SCI-6022]
---
app/assets/javascripts/shared/barcode_search.js | 3 ++-
app/views/repositories/_repository_row_info_modal.html.erb | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/assets/javascripts/shared/barcode_search.js b/app/assets/javascripts/shared/barcode_search.js
index 996f3bbf5..797f2afb0 100644
--- a/app/assets/javascripts/shared/barcode_search.js
+++ b/app/assets/javascripts/shared/barcode_search.js
@@ -1,6 +1,7 @@
$(document).on('click', '.barcode-scanner', function() {
var search = $('.search-container .search-field');
- var input = $('').attr('type', 'text').css('opacity', 0).appendTo('body');
+ var input = $('').attr('type', 'text').css({ position: 'absolute', right: 0, opacity: 0 })
+ .appendTo($('.search-container').parent());
search.val('');
search.attr('disabled', true).addClass('barcode-mode');
diff --git a/app/views/repositories/_repository_row_info_modal.html.erb b/app/views/repositories/_repository_row_info_modal.html.erb
index f80c6e376..e3359f13a 100644
--- a/app/views/repositories/_repository_row_info_modal.html.erb
+++ b/app/views/repositories/_repository_row_info_modal.html.erb
@@ -46,7 +46,7 @@
-
+