Button to Flash lights ON in barcodereader

Only to ON, not OFF (you can Cancel)
This commit is contained in:
Radim Kabeláč 2020-02-19 21:29:00 +01:00 committed by GitHub
parent de20699580
commit 4727ead67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,6 @@ Quagga.onProcessed(function(result)
$(document).on("click", "#barcodescanner-start-button", function(e)
{
e.preventDefault();
var inputElement = $(e.currentTarget).prev();
if (inputElement.hasAttr("disabled"))
{
@ -154,8 +153,17 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
},
size: 'big',
backdrop: true,
closeButton: false,
closeButton: true,
buttons: {
torch: {
label: __t('Torch'),
className: 'btn-primary responsive-button',
callback: function(){
var track = Quagga.CameraAccess.getActiveTrack();
track.applyConstraints({advanced: [{torch:true}]});
return false;
}
},
cancel: {
label: __t('Cancel'),
className: 'btn-secondary responsive-button',
@ -166,11 +174,9 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
}
}
});
Grocy.Components.BarcodeScanner.StartScanning();
});
setTimeout(function()
{
$(".barcodescanner-input:visible").each(function()