ui_report: Do not pass jQuery element to the html method.

Although it works, this feature is not documented.
This commit is contained in:
Priyank Patel
2021-06-15 17:55:41 +00:00
committed by Tim Abbott
parent 9e08c6db93
commit fd45ef57fa

View File

@@ -61,9 +61,8 @@ export function generic_embed_error(error_html) {
export function generic_row_button_error(xhr, btn) {
if (xhr.status >= 400 && xhr.status < 500) {
btn.closest("td").html(
$("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg),
);
const $error = $("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg);
btn.closest("td").empty().append($error);
} else {
btn.text($t({defaultMessage: "Failed!"}));
}