Commit d3e34cd1 authored by Simon Knox's avatar Simon Knox

appease lint

parent 97ecae00
...@@ -14,29 +14,28 @@ class TaskList { ...@@ -14,29 +14,28 @@ class TaskList {
init() { init() {
// Prevent duplicate event bindings // Prevent duplicate event bindings
this.disable(); this.disable();
$(this.selector + ' .js-task-list-container').taskList('enable'); $(`${this.selector} .js-task-list-container`).taskList('enable');
$(document).on('tasklist:changed', this.selector + ' .js-task-list-container', this.update); $(document).on('tasklist:changed', `${this.selector} .js-task-list-container`, this.update);
} }
disable() { disable() {
$(this.selector + ' .js-task-list-container').taskList('disable'); $(`${this.selector} .js-task-list-container`).taskList('disable');
return $(document).off('tasklist:changed', this.selector + ' .js-task-list-container'); return $(document).off('tasklist:changed', `${this.selector} .js-task-list-container`);
} }
update(e) { update(e) {
var patchData; const patchData = {};
patchData = {};
patchData[this.dataType] = { patchData[this.dataType] = {
'description': $(e.target).val() description: $(e.target).val(),
}; };
return $.ajax({ return $.ajax({
type: 'PATCH', type: 'PATCH',
url: $('form.js-issuable-update').attr('action'), url: $('form.js-issuable-update').attr('action'),
data: patchData, data: patchData,
success: function(result) { success: (result) => {
document.querySelector('#task_status').innerText = result.task_status; document.querySelector('#task_status').innerText = result.task_status;
document.querySelector('#task_status_short').innerText = result.task_status_short; document.querySelector('#task_status_short').innerText = result.task_status_short;
} },
}); });
} }
} }
......
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