fix: Set title attribute for page title

This commit is contained in:
Suraj Shetty 2020-12-21 19:52:49 +05:30
parent a30c1f8b43
commit ecd9089c8e

View file

@ -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 = '<span class="'+ icon +' text-muted" style="font-size: inherit;"></span> ' + 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) {