mirror of
https://github.com/grocy/grocy.git
synced 2026-04-06 21:06:15 +02:00
Allow toggling torch
This commit is contained in:
parent
c6a9a240e1
commit
ec5012750d
|
|
@ -15,6 +15,8 @@ Grocy.Components.BarcodeScanner.CheckCapabilities = function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Grocy.Components.BarcodeScanner.TorchState = false;
|
||||||
|
|
||||||
Grocy.Components.BarcodeScanner.StartScanning = function()
|
Grocy.Components.BarcodeScanner.StartScanning = function()
|
||||||
{
|
{
|
||||||
Grocy.Components.BarcodeScanner.DecodedCodesCount = 0;
|
Grocy.Components.BarcodeScanner.DecodedCodesCount = 0;
|
||||||
|
|
@ -178,7 +180,15 @@ $(document).on("click", "#barcodescanner-start-button", function(e)
|
||||||
className: 'btn-warning responsive-button torch',
|
className: 'btn-warning responsive-button torch',
|
||||||
callback: function()
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user