mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
Allow toggling torch
This commit is contained in:
parent
6b3ef4ee56
commit
a477902752
|
|
@ -15,6 +15,8 @@ Grocy.Components.BarcodeScanner.CheckCapabilities = function()
|
|||
}
|
||||
}
|
||||
|
||||
Grocy.Components.BarcodeScanner.TorchState = false;
|
||||
|
||||
Grocy.Components.BarcodeScanner.StartScanning = function()
|
||||
{
|
||||
Grocy.Components.BarcodeScanner.DecodedCodesCount = 0;
|
||||
|
|
@ -178,7 +180,15 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
|
|||
className: 'btn-warning responsive-button torch',
|
||||
callback: function()
|
||||
{
|
||||
Quagga.CameraAccess.getActiveTrack().applyConstraints({ advanced: [{ torch: true }] });
|
||||
Grocy.Components.BarcodeScanner.TorchState = !Grocy.Components.BarcodeScanner.TorchState;
|
||||
|
||||
Quagga.CameraAccess.getActiveTrack().applyConstraints({
|
||||
advanced: [
|
||||
{
|
||||
torch: Grocy.Components.BarcodeScanner.TorchState
|
||||
}
|
||||
]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user