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

Moved how we remove event listeners

parent b2e5240a
......@@ -3,20 +3,13 @@
class Members {
constructor() {
this.removeListeners();
this.addListeners();
}
removeListeners() {
$('.project_member, .group_member').off('ajax:success');
$('.js-member-update-control').off('change');
$('.js-edit-member-form').off('ajax:success');
}
addListeners() {
$('.project_member, .group_member').on('ajax:success', this.removeRow);
$('.js-member-update-control').on('change', this.formSubmit);
$('.js-edit-member-form').on('ajax:success', this.formSuccess);
$('.project_member, .group_member').off('ajax:success').on('ajax:success', this.removeRow);
$('.js-member-update-control').off('change').on('change', this.formSubmit);
$('.js-edit-member-form').off('ajax:success').on('ajax:success', this.formSuccess);
}
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