mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
We don't need that switch-button, a native Boostrap button is enough and less disturbing
This commit is contained in:
@@ -521,10 +521,6 @@ if (GetUriParam("embedded") !== undefined)
|
||||
// Default input field
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
|
||||
// Can only be set via JS however...
|
||||
$("#scan-mode").addClass("user-setting-control");
|
||||
$("#scan-mode").attr("data-setting-key", "scan_mode_consume_enabled");
|
||||
|
||||
$(document).on("change", "#scan-mode", function(e)
|
||||
{
|
||||
if ($(this).prop("checked"))
|
||||
@@ -532,3 +528,18 @@ $(document).on("change", "#scan-mode", function(e)
|
||||
Grocy.UISound.AskForPermission();
|
||||
}
|
||||
});
|
||||
|
||||
$("#scan-mode-button").on("click", function(e)
|
||||
{
|
||||
document.activeElement.blur();
|
||||
$("#scan-mode").click();
|
||||
$("#scan-mode-button").toggleClass("btn-success").toggleClass("btn-danger");
|
||||
if ($("#scan-mode").prop("checked"))
|
||||
{
|
||||
$("#scan-mode-status").text(__t("on"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#scan-mode-status").text(__t("off"));
|
||||
}
|
||||
});
|
||||
|
@@ -362,14 +362,25 @@ function UndoStockTransaction(transactionId)
|
||||
);
|
||||
};
|
||||
|
||||
// Can only be set via JS however...
|
||||
$("#scan-mode").addClass("user-setting-control");
|
||||
$("#scan-mode").attr("data-setting-key", "scan_mode_purchase_enabled");
|
||||
|
||||
$(document).on("change", "#scan-mode", function(e)
|
||||
$("#scan-mode").on("change", function(e)
|
||||
{
|
||||
if ($(this).prop("checked"))
|
||||
{
|
||||
Grocy.UISound.AskForPermission();
|
||||
}
|
||||
});
|
||||
|
||||
$("#scan-mode-button").on("click", function(e)
|
||||
{
|
||||
document.activeElement.blur();
|
||||
$("#scan-mode").click();
|
||||
$("#scan-mode-button").toggleClass("btn-success").toggleClass("btn-danger");
|
||||
if ($("#scan-mode").prop("checked"))
|
||||
{
|
||||
$("#scan-mode-status").text(__t("on"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#scan-mode-status").text(__t("off"));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user