Button to Flashlight ON in Barcodescanner (#574)

* Button to Flash lights ON in barcodereader

Only to ON, not OFF (you can Cancel)

* First documentation files for ReadThedoc

* Delete index.md

* Delete mkdocs.yml

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
Radim Kabeláč 2020-03-01 17:53:28 +01:00 committed by GitHub
parent 14c9c045e7
commit 51cd81422e
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) $(document).on("click", "#barcodescanner-start-button", function(e)
{ {
e.preventDefault(); e.preventDefault();
var inputElement = $(e.currentTarget).prev(); var inputElement = $(e.currentTarget).prev();
if (inputElement.hasAttr("disabled")) if (inputElement.hasAttr("disabled"))
{ {
@ -154,8 +153,17 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
}, },
size: 'big', size: 'big',
backdrop: true, backdrop: true,
closeButton: false, closeButton: true,
buttons: { 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: { cancel: {
label: __t('Cancel'), label: __t('Cancel'),
className: 'btn-secondary responsive-button', className: 'btn-secondary responsive-button',
@ -166,11 +174,9 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
} }
} }
}); });
Grocy.Components.BarcodeScanner.StartScanning(); Grocy.Components.BarcodeScanner.StartScanning();
}); });
setTimeout(function() setTimeout(function()
{ {
$(".barcodescanner-input:visible").each(function() $(".barcodescanner-input:visible").each(function()