From 489a15704c0c3a9604457d1e4bba8b915ae9d698 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 28 Jan 2021 22:41:20 +1100 Subject: [PATCH] Refactoring --- InvenTree/templates/js/barcode.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/InvenTree/templates/js/barcode.js b/InvenTree/templates/js/barcode.js index 7a04aaa11d..d91eb85e68 100644 --- a/InvenTree/templates/js/barcode.js +++ b/InvenTree/templates/js/barcode.js @@ -1,12 +1,14 @@ {% load i18n %} -function makeBarcodeInput(placeholderText='') { +function makeBarcodeInput(placeholderText='', hintText='') { /* * Generate HTML for a barcode input */ placeholderText = placeholderText || '{% trans "Scan barcode data here using wedge scanner" %}'; + hintText = hintText || '{% trans "Enter barcode data" %}'; + var html = `
@@ -17,7 +19,7 @@ function makeBarcodeInput(placeholderText='') {
-
{% trans "Enter barcode data" %}
+
${hintText}
`; @@ -28,6 +30,7 @@ function makeBarcodeInput(placeholderText='') { function makeNotesField(options={}) { var tooltip = options.tooltip || '{% trans "Enter optional notes for stock transfer" %}'; + var placeholder = options.placeholder || '{% trans "Enter notes" %}'; return `
@@ -37,7 +40,7 @@ function makeNotesField(options={}) { - +
${tooltip}