* Fix & cleanup config in popup. Closes #602 * Hide icon for USO with no config
This commit is contained in:
parent
8b8a3d60ab
commit
7f3013f477
|
@ -276,15 +276,24 @@ function createStyleElement({
|
||||||
});
|
});
|
||||||
styleName.checkbox = checkbox;
|
styleName.checkbox = checkbox;
|
||||||
styleName.appendChild(document.createTextNode(' '));
|
styleName.appendChild(document.createTextNode(' '));
|
||||||
|
|
||||||
const config = $('.configure', entry);
|
const config = $('.configure', entry);
|
||||||
if (!style.usercssData && style.updateUrl && style.updateUrl.includes('?') && style.url) {
|
config.onclick = handleEvent.configure;
|
||||||
config.target = '_blank';
|
if (!style.usercssData) {
|
||||||
config.title = t('configureStyleOnHomepage');
|
if (style.updateUrl && style.updateUrl.includes('?') && style.url) {
|
||||||
config.dataset.sendMessage = JSON.stringify({method: 'openSettings'});
|
config.href = style.url;
|
||||||
$('use', config).attributes['xlink:href'].nodeValue = '#svg-icon-config-uso';
|
config.target = '_blank';
|
||||||
|
config.title = t('configureStyleOnHomepage');
|
||||||
|
config.dataset.sendMessage = JSON.stringify({method: 'openSettings'});
|
||||||
|
$('use', config).attributes['xlink:href'].nodeValue = '#svg-icon-config-uso';
|
||||||
|
} else {
|
||||||
|
config.classList.add('hidden');
|
||||||
|
}
|
||||||
|
} else if (Object.keys(style.usercssData.vars || {}).length === 0) {
|
||||||
|
config.classList.add('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.delete', entry).onclick = handleEvent.delete;
|
$('.delete', entry).onclick = handleEvent.delete;
|
||||||
$('.configure', entry).onclick = handleEvent.configure;
|
|
||||||
|
|
||||||
const indicator = template.regexpProblemIndicator.cloneNode(true);
|
const indicator = template.regexpProblemIndicator.cloneNode(true);
|
||||||
indicator.appendChild(document.createTextNode('!'));
|
indicator.appendChild(document.createTextNode('!'));
|
||||||
|
@ -307,15 +316,6 @@ function createStyleElement({
|
||||||
styleName.textContent : '';
|
styleName.textContent : '';
|
||||||
});
|
});
|
||||||
|
|
||||||
const config = $('.configure', entry);
|
|
||||||
if (!style.usercssData && style.updateUrl && style.updateUrl.includes('?') && style.url) {
|
|
||||||
config.href = style.url;
|
|
||||||
}
|
|
||||||
config.style.display =
|
|
||||||
!style.usercssData && config.href ||
|
|
||||||
style.usercssData && Object.keys(style.usercssData.vars || {}).length ?
|
|
||||||
'' : 'none';
|
|
||||||
|
|
||||||
entry.classList.toggle('not-applied', style.excluded || style.sloppy);
|
entry.classList.toggle('not-applied', style.excluded || style.sloppy);
|
||||||
entry.classList.toggle('regexp-partial', style.sloppy);
|
entry.classList.toggle('regexp-partial', style.sloppy);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user