fix: use get_seen_class as class method
This commit is contained in:
parent
9ce9d39669
commit
ccaa607b2b
2 changed files with 8 additions and 6 deletions
|
|
@ -784,6 +784,12 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
return '#Form/' + this.doctype + '/' + docname;
|
||||
}
|
||||
|
||||
get_seen_class(doc) {
|
||||
return JSON.parse(doc._seen || '[]').includes(frappe.session.user)
|
||||
? ''
|
||||
: 'bold';
|
||||
}
|
||||
|
||||
get_subject_html(doc) {
|
||||
let user = frappe.session.user;
|
||||
let subject_field = this.columns[0].df;
|
||||
|
|
@ -795,10 +801,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList {
|
|||
let heart_class = liked_by.includes(user) ?
|
||||
'liked-by' : 'text-extra-muted not-liked';
|
||||
|
||||
const seen = this.get_seen
|
||||
? this.get_seen(doc)
|
||||
: JSON.parse(doc._seen || '[]')
|
||||
.includes(user) ? '' : 'bold';
|
||||
const seen = this.get_seen_class(doc);
|
||||
|
||||
let subject_html = `
|
||||
<input class="level-item list-row-checkbox hidden-xs" type="checkbox" data-name="${escape(doc.name)}">
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ frappe.views.InboxView = class InboxView extends frappe.views.ListView {
|
|||
this.email_account = frappe.get_route()[3];
|
||||
this.page_title = this.email_account;
|
||||
this.filters = this.get_inbox_filters();
|
||||
this.get_seen = (doc) => this.set_seen(doc);
|
||||
}
|
||||
|
||||
setup_columns() {
|
||||
|
|
@ -70,7 +69,7 @@ frappe.views.InboxView = class InboxView extends frappe.views.ListView {
|
|||
});
|
||||
}
|
||||
|
||||
set_seen(doc) {
|
||||
get_seen_class(doc) {
|
||||
const seen =
|
||||
Boolean(doc.seen) || JSON.parse(doc._seen || '[]').includes(frappe.session.user)
|
||||
? ''
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue