Commit 96ee9758 authored by Phil Hughes's avatar Phil Hughes

Moved how we remove event listeners

parent b2e5240a
...@@ -3,20 +3,13 @@ ...@@ -3,20 +3,13 @@
class Members { class Members {
constructor() { constructor() {
this.removeListeners();
this.addListeners(); this.addListeners();
} }
removeListeners() {
$('.project_member, .group_member').off('ajax:success');
$('.js-member-update-control').off('change');
$('.js-edit-member-form').off('ajax:success');
}
addListeners() { addListeners() {
$('.project_member, .group_member').on('ajax:success', this.removeRow); $('.project_member, .group_member').off('ajax:success').on('ajax:success', this.removeRow);
$('.js-member-update-control').on('change', this.formSubmit); $('.js-member-update-control').off('change').on('change', this.formSubmit);
$('.js-edit-member-form').on('ajax:success', this.formSuccess); $('.js-edit-member-form').off('ajax:success').on('ajax:success', this.formSuccess);
} }
removeRow(e) { removeRow(e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment