Skip to content

Commit

Permalink
js-btn-reject.onClick was behaving unexpectedly
Browse files Browse the repository at this point in the history
Had to add `onNext` and `onBack` overrides to modal class in order to maintain functionality
  • Loading branch information
droberts-ctrlo committed Dec 11, 2024
1 parent 42a5385 commit 9c21e58
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/frontend/components/modal/modals/user/lib/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

0 comments on commit 9c21e58

Please sign in to comment.