From 1275af43cdf49bdbeb6b47c2aee6e1aa55ebd06b Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 8 Jul 2020 13:33:10 +0530 Subject: [PATCH] refactor: pass only wrapper to base notification --- .../js/frappe/ui/notifications/notifications.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index 19ee6c96c1..1b68394e7d 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -23,7 +23,6 @@ frappe.ui.Notifications = class Notifications { ); this.user = frappe.session.user; - this.max_length = 20; this.setup_headers(); let me = this; @@ -97,10 +96,7 @@ frappe.ui.Notifications = class Notifications { } make_tab_view(item) { - let tabView = new item.view({ - wrapper: this.body, - max_length: this.max_length - }); + let tabView = new item.view(this.body); this.tabs[item.id] = tabView; this.current_tab = tabView; tabView.show(); @@ -235,9 +231,10 @@ frappe.ui.notifications = { }; class BaseNotificaitonsView { - constructor(opts) { + constructor(wrapper) { // wrapper, max_length - Object.assign(this, opts) + this.wrapper = wrapper; + this.max_length = 20; this.container = $(`
`).appendTo(this.wrapper); this.make(); }