Skip to content

Commit

Permalink
feat: show doctype description on list title hover (backport #24612) (#…
Browse files Browse the repository at this point in the history
…24769)

* feat: show doctype description on list title hover

* fix: handle missing meta.description for query report view

(cherry picked from commit 0967cc4)

Co-authored-by: Rucha Mahabal <ruchamahabal2@gmail.com>
  • Loading branch information
mergify[bot] and ruchamahabal committed Feb 5, 2024
1 parent 3ede452 commit 5a0e20b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/list/base_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ frappe.views.BaseList = class BaseList {
}

set_title() {
this.page.set_title(this.page_title);
this.page.set_title(this.page_title, null, true, "", this.meta?.description);
}

setup_view_menu() {
Expand Down
8 changes: 6 additions & 2 deletions frappe/public/js/frappe/ui/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ frappe.ui.Page = class Page {
return this.$title_area;
}

set_title(title, icon = null, strip = true, tab_title = "") {
set_title(title, icon = null, strip = true, tab_title = "", tooltip_label = "") {
if (!title) title = "";
if (strip) {
title = strip_html(title);
Expand All @@ -745,7 +745,11 @@ frappe.ui.Page = class Page {
}
let title_wrapper = this.$title_area.find(".title-text");
title_wrapper.html(title);
title_wrapper.attr("title", this.title);
title_wrapper.attr("title", tooltip_label || this.title);

if (tooltip_label) {
title_wrapper.tooltip({ delay: { show: 600, hide: 100 }, trigger: "hover" });
}
}

set_title_sub(txt) {
Expand Down

0 comments on commit 5a0e20b

Please sign in to comment.