diff --git a/src/apps/dashboard/controllers/dashboard.js b/src/apps/dashboard/controllers/dashboard.js index e29bb4778d..334fb7e3ec 100644 --- a/src/apps/dashboard/controllers/dashboard.js +++ b/src/apps/dashboard/controllers/dashboard.js @@ -383,7 +383,7 @@ function renderRunningTasks(view, tasks) { html += progress + '%'; html += ''; html += "" + progress + '%'; - html += ''; + html += ''; } else if (task.State === 'Cancelling') { html += '' + globalize.translate('LabelStopping') + ''; } @@ -391,7 +391,12 @@ function renderRunningTasks(view, tasks) { html += '

'; } - view.querySelector('#divRunningTasks').innerHTML = html; + const runningTasks = view.querySelector('#divRunningTasks'); + + runningTasks.innerHTML = html; + runningTasks.querySelectorAll('.btnTaskCancel').forEach(function (btn) { + btn.addEventListener('click', () => DashboardPage.stopTask(btn, btn.dataset.taskId)); + }); } const DashboardPage = {