Disable active change switch until interaction completion
This commit is contained in:
parent
fad9216969
commit
2978f99eeb
@ -299,7 +299,10 @@
|
||||
// Make the switch toggle the active flag
|
||||
template.find(".sub-active").prop("checked", data.active).change(function() {
|
||||
|
||||
var isChecked = $(this).prop("checked");
|
||||
var checkbox = $(this);
|
||||
|
||||
checkbox.prop("disabled", true);
|
||||
var isChecked = checkbox.prop("checked");
|
||||
var activeText = isChecked === true ? "active" : "inactive";
|
||||
|
||||
var formData = new FormData();
|
||||
@ -307,6 +310,7 @@
|
||||
|
||||
patchSubscription(data.uuid, formData).then(function(resp) {
|
||||
showToast("success", "Subscription Modified", `<b>${data.name}</b> is now <b>${activeText}</b>.`);
|
||||
checkbox.prop("disabled", false);
|
||||
})
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user