realign #only-updates filter and rename as it's not linked to prefs

This commit is contained in:
tophf 2017-12-07 01:39:15 +03:00
parent ebef35c28c
commit 119a3803ec
4 changed files with 14 additions and 7 deletions

View File

@ -227,7 +227,7 @@
</div>
</div>
<label id="onlyUpdates" class="hidden">
<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)">

View File

@ -392,8 +392,8 @@ Object.assign(document.body, {
this.ondragend();
if (event.dataTransfer.files.length) {
event.preventDefault();
if ($('#onlyUpdates input').checked) {
$('#onlyUpdates input').click();
if ($('#only-updates input').checked) {
$('#only-updates input').click();
}
importFromFile({file: event.dataTransfer.files[0]});
}

View File

@ -392,6 +392,13 @@ select {
background-color: hsla(0, 0%, 50%, .2);
}
#only-updates {
position: relative;
left: -5px;
margin-top: 2px;
margin-bottom: 2px;
}
.checkmate {
position: relative;
height: 12px;

View File

@ -108,7 +108,7 @@ function reportUpdateState(state, style, details) {
entry.classList.add('can-update');
entry.updatedCode = style;
$('.update-note', entry).textContent = '';
$('#onlyUpdates').classList.remove('hidden');
$('#only-updates').classList.remove('hidden');
break;
case BG.updater.SKIPPED: {
if (entry.classList.contains('can-update')) {
@ -151,12 +151,12 @@ function reportUpdateState(state, style, details) {
function renderUpdatesOnlyFilter({show, check} = {}) {
const numUpdatable = $$('.can-update').length;
const mightUpdate = numUpdatable > 0 || $('.update-problem');
const checkbox = $('#onlyUpdates input');
const checkbox = $('#only-updates input');
show = show !== undefined ? show : mightUpdate;
check = check !== undefined ? show && check : checkbox.checked && mightUpdate;
$('#onlyUpdates').classList.toggle('hidden', !show);
checkbox.checked = check;
$('#only-updates').classList.toggle('hidden', !show);
checkbox.checked = check && show;
checkbox.dispatchEvent(new Event('change'));
const btnApply = $('#apply-all-updates');