Fixed DOMSubtreeModified deprecation notice

This commit is contained in:
Bernd Bestel 2024-12-23 17:20:23 +01:00
parent 58eda2f152
commit cd25284d35
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -624,9 +624,22 @@ function RefreshLocaleNumberDisplay(rootSelector = "#page-content")
}); });
} }
RefreshLocaleNumberDisplay(); RefreshLocaleNumberDisplay();
$(document).on("DOMSubtreeModified", ".locale-number", function() $(".locale-number").each(function()
{ {
$(this).removeClass("number-parsing-done"); new MutationObserver(function(mutations)
{
mutations.forEach(mutation =>
{
if (mutation.type == "childList" || mutation.type == "attributes")
{
$(mutation.target).removeClass("number-parsing-done");
}
});
}).observe(this, {
attributes: true,
childList: true,
subtree: true
});
}); });
function RefreshLocaleNumberInput(rootSelector = "#page-content") function RefreshLocaleNumberInput(rootSelector = "#page-content")