refactor: button inner text change without html manipulation

This commit is contained in:
Shrihari Mahabal 2026-02-24 12:52:15 +05:30
parent f1dd3da3f0
commit bb23efd4e7

View file

@ -320,9 +320,11 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
const btnRect = btn[0].getBoundingClientRect();
if (btnRect.right > containerRect.right) {
const short_label = __("Add");
btn.attr("title", add_button_label)
.tooltip({ delay: { show: 100, hide: 100 }, trigger: "hover" })
.html(`<span class="hidden-xs"> ${short_label} </span>`);
btn.attr("title", add_button_label).tooltip({
delay: { show: 100, hide: 100 },
trigger: "hover",
});
btn.find("span").text(short_label);
}
}