From 59bd4fffa8e46aa95858c4d058f55734c4f3265e Mon Sep 17 00:00:00 2001 From: j Date: Tue, 20 Sep 2016 01:17:22 +0200 Subject: [PATCH] use loop --- static/js/tasksDialog.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/static/js/tasksDialog.js b/static/js/tasksDialog.js index a2f74ca46..d99102e80 100644 --- a/static/js/tasksDialog.js +++ b/static/js/tasksDialog.js @@ -99,7 +99,6 @@ pandora.ui.tasksDialog = function(options) { title: Ox._('Progress'), visible: false } - ], columnsVisible: true, items: listItems, @@ -336,11 +335,11 @@ pandora.ui.tasksDialog = function(options) { if (Ox.getIndexById(listItems, item.id) == -1) { hasNewItems = true; } else if (!hasNewItems) { - $list.value(item.id, 'progress', item.progress); - $list.value(item.id, 'status', item.status); - if (item.ended) { - $list.value(item.id, 'ended', item.ended); - } + ['progress', 'status'].concat( + item.ended ? ['ended'] : [] + ).forEach(function(key) { + $list.value(item.id, key, item[key]); + }); } }); hasNewItems && updateList();