From 9c21e58401d3a26b62aa638ac8aed3138fc7bf43 Mon Sep 17 00:00:00 2001 From: Dave Roberts Date: Wed, 11 Dec 2024 15:15:42 +0000 Subject: [PATCH] `js-btn-reject.onClick` was behaving unexpectedly Had to add `onNext` and `onBack` overrides to modal class in order to maintain functionality --- .../modal/modals/user/lib/component.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/frontend/components/modal/modals/user/lib/component.js b/src/frontend/components/modal/modals/user/lib/component.js index 68c9dd5d7..1b47d3fc0 100644 --- a/src/frontend/components/modal/modals/user/lib/component.js +++ b/src/frontend/components/modal/modals/user/lib/component.js @@ -23,7 +23,8 @@ class UserModalComponent extends ModalComponent { // Toggle the right content (add user or approve account) toggleContent(ev) { - if ($(ev.relatedTarget).hasClass('btn-add')) { + this.target = $(ev.relatedTarget) + if (this.target.hasClass('btn-add')) { modal.clear() this.el.find('.js-approve-account').hide() this.el.find('.js-add-user').show() @@ -92,6 +93,22 @@ class UserModalComponent extends ModalComponent { super.handleClose() this.emailText.html("USER") } + + handleBack() { + super.handleBack() + if(this.target.hasClass('btn-add')) return; + this.el.find('.btn-js-reject-request').off().on("click", ()=>{ + this.activateFrame(4); + }); + } + + handleNext() { + super.handleNext() + if(this.target.hasClass('btn-add')) return; + this.el.find('.btn-js-reject-request').off().on("click", ()=>{ + this.activateFrame(4); + }); + } } export default UserModalComponent