From 876b8cc9840e196d26fc924e30a7ab2cd017714d Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 27 Jul 2023 11:10:20 +0300 Subject: [PATCH] action handler pass target --- client/src/view.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/view.js b/client/src/view.js index af60ed0ee6..94c442bc81 100644 --- a/client/src/view.js +++ b/client/src/view.js @@ -41,6 +41,7 @@ class View extends BullView { /** * @callback module:view~actionHandlerCallback * @param {Event} e A DOM event. + * @param {HTMLElement} element A target element. */ /** @@ -77,9 +78,9 @@ class View extends BullView { * @param {module:view~actionHandlerCallback} handler A handler. */ addActionHandler(action, handler) { - let fullAction = `click [data-action="${action}"]`; + const fullAction = `click [data-action="${action}"]`; - this.events[fullAction] = e => handler(e.originalEvent); + this.events[fullAction] = e => handler(e.originalEvent, e.currentTarget); } /**