Commit fe71edc3 authored by Phil Hughes's avatar Phil Hughes

JS update

parent e747626f
...@@ -15,14 +15,8 @@ ...@@ -15,14 +15,8 @@
addListeners() { addListeners() {
$('.project_member, .group_member').on('ajax:success', this.removeRow); $('.project_member, .group_member').on('ajax:success', this.removeRow);
$('.js-member-update-control').on('change', function () { $('.js-member-update-control').on('change', this.formSubmit);
$(this).closest('form') $('.js-edit-member-form').on('ajax:success', this.formSuccess);
.trigger("submit.rails");
$(this).disable();
});
$('.js-edit-member-form').on('ajax:success', function () {
$(this).find('.js-member-update-control').enable();
});
} }
removeRow(e) { removeRow(e) {
...@@ -36,8 +30,16 @@ ...@@ -36,8 +30,16 @@
} }
} }
submitForm() { formSubmit() {
const $this = $(this);
$this.disable()
.closest('form')
.trigger("submit.rails");
}
formSuccess() {
$(this).find('.js-member-update-control').enable();
} }
} }
......
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