From ec0b1373fe185ca385ba1c9ed5563a761065d0d7 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 15 Aug 2018 09:36:29 +0300 Subject: [PATCH] show update-all button on individual check too sometimes users may want to check a bunch of styles for updates individually and install the found updates at once --- manage.html | 4 +++- manage/updater-ui.js | 12 ++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/manage.html b/manage.html index eb89b044..df581f3f 100644 --- a/manage.html +++ b/manage.html @@ -247,7 +247,9 @@ diff --git a/manage/updater-ui.js b/manage/updater-ui.js index b9cf151b..4eaca65d 100644 --- a/manage/updater-ui.js +++ b/manage/updater-ui.js @@ -66,7 +66,6 @@ function checkUpdateAll() { if (info.updated) { if (++updated === 1) { btnApply.disabled = true; - btnApply.classList.remove('hidden'); } btnApply.dataset.value = updated; } @@ -179,6 +178,8 @@ function reportUpdateState({updated, style, error, STATES}) { if (filtersSelector.hide && isCheckAll) { filterAndAppend({entry}).then(sorter.updateStripes); + } else if (updated && !isCheckAll) { + renderUpdatesOnlyFilter(); } } @@ -195,13 +196,8 @@ function renderUpdatesOnlyFilter({show, check} = {}) { checkbox.dispatchEvent(new Event('change')); const btnApply = $('#apply-all-updates'); - if (!btnApply.matches('.hidden')) { - if (numUpdatable > 0) { - btnApply.dataset.value = numUpdatable; - } else { - btnApply.classList.add('hidden'); - } - } + btnApply.classList.toggle('hidden', !numUpdatable); + btnApply.dataset.value = numUpdatable; }