diff --git a/frappe/public/js/frappe/ui/page.js b/frappe/public/js/frappe/ui/page.js index 8088476986..2b13423af5 100644 --- a/frappe/public/js/frappe/ui/page.js +++ b/frappe/public/js/frappe/ui/page.js @@ -646,19 +646,19 @@ frappe.ui.Page = Class.extend({ return this.$title_area; }, - set_title: function(txt, icon = '', stripHtml = true, tabTitle = '') { - if(!txt) txt = ""; - - if(stripHtml) { - txt = strip_html(txt); + set_title: function(title, icon=null, strip=true, tab_title="") { + if (!title) title = ""; + if (strip) { + title = strip_html(title); } - this.title = txt; - - frappe.utils.set_title(tabTitle || txt); - if(icon) { - txt = ' ' + txt; + this.title = title; + frappe.utils.set_title(tab_title || title); + if (icon) { + title = `${frappe.utils.icon(icon)} ${title}`; } - this.$title_area.find(".title-text").html(txt); + let title_wrapper = this.$title_area.find(".title-text"); + title_wrapper.html(title); + title_wrapper.attr('title', this.title); }, set_title_sub: function(txt) {