mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Prevent form submit when any combobox-dropdown is open (fixes #1236)
This commit is contained in:
parent
1e27f6c127
commit
1459f8c441
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#battery-form').serializeJSON();
|
var jsonData = $('#battery-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("battery-form");
|
Grocy.FrontendHelpers.BeginUiBusy("battery-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#batterytracking-form').serializeJSON();
|
var jsonForm = $('#batterytracking-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("batterytracking-form");
|
Grocy.FrontendHelpers.BeginUiBusy("batterytracking-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#chore-form').serializeJSON();
|
var jsonData = $('#chore-form').serializeJSON();
|
||||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#choretracking-form').serializeJSON();
|
var jsonForm = $('#choretracking-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("choretracking-form");
|
Grocy.FrontendHelpers.BeginUiBusy("choretracking-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#consume-form').serializeJSON();
|
var jsonForm = $('#consume-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("consume-form");
|
Grocy.FrontendHelpers.BeginUiBusy("consume-form");
|
||||||
|
|
||||||
@ -139,6 +144,11 @@ $('#save-mark-as-open-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#consume-form').serializeJSON();
|
var jsonForm = $('#consume-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("consume-form");
|
Grocy.FrontendHelpers.BeginUiBusy("consume-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#equipment-form').serializeJSON();
|
var jsonData = $('#equipment-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("equipment-form");
|
Grocy.FrontendHelpers.BeginUiBusy("equipment-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#inventory-form').serializeJSON();
|
var jsonForm = $('#inventory-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("inventory-form");
|
Grocy.FrontendHelpers.BeginUiBusy("inventory-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#location-form').serializeJSON();
|
var jsonData = $('#location-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("location-form");
|
Grocy.FrontendHelpers.BeginUiBusy("location-form");
|
||||||
|
|
||||||
|
@ -394,6 +394,11 @@ $('#save-add-recipe-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.getElementById("add-recipe-form").checkValidity() === false) //There is at least one validation error
|
if (document.getElementById("add-recipe-form").checkValidity() === false) //There is at least one validation error
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -431,6 +436,11 @@ $('#save-add-note-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.getElementById("add-note-form").checkValidity() === false) //There is at least one validation error
|
if (document.getElementById("add-note-form").checkValidity() === false) //There is at least one validation error
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -472,6 +482,11 @@ $('#save-add-product-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.getElementById("add-product-form").checkValidity() === false) //There is at least one validation error
|
if (document.getElementById("add-product-form").checkValidity() === false) //There is at least one validation error
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#barcode-form').serializeJSON();
|
var jsonData = $('#barcode-form').serializeJSON();
|
||||||
jsonData.amount = jsonData.display_amount;
|
jsonData.amount = jsonData.display_amount;
|
||||||
delete jsonData.display_amount;
|
delete jsonData.display_amount;
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#product-group-form').serializeJSON();
|
var jsonData = $('#product-group-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("product-group-form");
|
Grocy.FrontendHelpers.BeginUiBusy("product-group-form");
|
||||||
|
|
||||||
|
@ -4,6 +4,16 @@ $('#save-purchase-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#purchase-form').serializeJSON();
|
var jsonForm = $('#purchase-form').serializeJSON();
|
||||||
|
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("purchase-form");
|
Grocy.FrontendHelpers.BeginUiBusy("purchase-form");
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#quconversion-form').serializeJSON();
|
var jsonData = $('#quconversion-form').serializeJSON();
|
||||||
jsonData.from_qu_id = $("#from_qu_id").val();
|
jsonData.from_qu_id = $("#from_qu_id").val();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("quconversion-form");
|
Grocy.FrontendHelpers.BeginUiBusy("quconversion-form");
|
||||||
|
@ -299,6 +299,11 @@ $('#save-recipe-include-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (document.getElementById("recipe-include-form").checkValidity() === false) //There is at least one validation error
|
if (document.getElementById("recipe-include-form").checkValidity() === false) //There is at least one validation error
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -4,6 +4,11 @@ $('#save-recipe-pos-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#recipe-pos-form').serializeJSON();
|
var jsonData = $('#recipe-pos-form').serializeJSON();
|
||||||
jsonData.recipe_id = Grocy.EditObjectParentId;
|
jsonData.recipe_id = Grocy.EditObjectParentId;
|
||||||
delete jsonData.display_amount;
|
delete jsonData.display_amount;
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#shopping-list-form').serializeJSON();
|
var jsonData = $('#shopping-list-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("shopping-list-form");
|
Grocy.FrontendHelpers.BeginUiBusy("shopping-list-form");
|
||||||
|
|
||||||
|
@ -4,6 +4,11 @@ $('#save-shoppinglist-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#shoppinglist-form').serializeJSON();
|
var jsonData = $('#shoppinglist-form').serializeJSON();
|
||||||
if (!jsonData.product_id)
|
if (!jsonData.product_id)
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#shoppinglocation-form').serializeJSON();
|
var jsonData = $('#shoppinglocation-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("shoppinglocation-form");
|
Grocy.FrontendHelpers.BeginUiBusy("shoppinglocation-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#stockentry-form').serializeJSON();
|
var jsonForm = $('#stockentry-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("stockentry-form");
|
Grocy.FrontendHelpers.BeginUiBusy("stockentry-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#task-category-form').serializeJSON();
|
var jsonData = $('#task-category-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("task-category-form");
|
Grocy.FrontendHelpers.BeginUiBusy("task-category-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#task-form').serializeJSON();
|
var jsonData = $('#task-form').serializeJSON();
|
||||||
jsonData.assigned_to_user_id = jsonData.user_id;
|
jsonData.assigned_to_user_id = jsonData.user_id;
|
||||||
delete jsonData.user_id;
|
delete jsonData.user_id;
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonForm = $('#transfer-form').serializeJSON();
|
var jsonForm = $('#transfer-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("transfer-form");
|
Grocy.FrontendHelpers.BeginUiBusy("transfer-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#userentity-form').serializeJSON();
|
var jsonData = $('#userentity-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("userentity-form");
|
Grocy.FrontendHelpers.BeginUiBusy("userentity-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#userfield-form').serializeJSON();
|
var jsonData = $('#userfield-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("userfield-form");
|
Grocy.FrontendHelpers.BeginUiBusy("userfield-form");
|
||||||
|
|
||||||
|
@ -28,6 +28,11 @@ $('#save-user-button').on('click', function(e)
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = $('#user-form').serializeJSON();
|
var jsonData = $('#user-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("user-form");
|
Grocy.FrontendHelpers.BeginUiBusy("user-form");
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@
|
|||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if ($(".combobox-menu-visible").length)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var jsonData = {};
|
var jsonData = {};
|
||||||
jsonData.userentity_id = Grocy.EditObjectParentId;
|
jsonData.userentity_id = Grocy.EditObjectParentId;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user