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
This commit is contained in:
tophf 2018-08-15 09:36:29 +03:00
parent 799178a16f
commit ec0b1373fe
2 changed files with 7 additions and 9 deletions

View File

@ -247,7 +247,9 @@
<label id="only-updates" class="hidden">
<input type="checkbox"
data-filter=".can-update, .update-problem, .update-done"
data-filter-hide=":not(.updatable):not(.update-done), .no-update:not(.update-problem)">
data-filter-hide=":not(.updatable):not(.update-done),
.no-update:not(.update-problem),
.updatable:not(.can-update):not(.update-problem):not(.update-done)">
<svg class="svg-icon checked"><use xlink:href="#svg-icon-checked"/></svg>
<span i18n-text="manageOnlyUpdates"></span>
</label>

View File

@ -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;
}