Merge pull request #36 from 0xAF/ui_themes2

animate receiver sections expand/colapse
This commit is contained in:
Luarvique L. Luarvique 2023-11-08 21:52:19 -05:00 committed by GitHub
commit e37667d7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View File

@ -1683,4 +1683,10 @@ img.openwebrx-mirror-img
.openwebrx-section {
display: block;
overflow-y: hidden;
transition: max-height 0.25s ease-out;
max-height: 15rem;
}
.openwebrx-section.closed {
max-height: 0;
}

View File

@ -260,7 +260,7 @@
</div>
</div>
<div id="openwebrx-section-settings" class="openwebrx-section-divider" onclick="UI.toggleSection(this);">&blacktriangle;&nbsp;Settings</div>
<div class="openwebrx-section" style="display: none;">
<div class="openwebrx-section closed">
<div class="openwebrx-panel-line">
<div title="Reset theme" class="openwebrx-button openwebrx-slider-button" onclick="UI.setTheme('default');">
<svg viewBox="56 -900 835 835" style="overflow: visible"><use xlink:href="static/gfx/svg-defs.svg#theme-chooser"></use></svg>

View File

@ -135,13 +135,13 @@ UI.toggleSection = function(el, on) {
var next_el = el.nextElementSibling;
if (next_el) {
if ((next_el.style.display === 'none') && (toggle || on)) {
if ((next_el.classList.contains('closed')) && (toggle || on)) {
el.innerHTML = el.innerHTML.replace('\u25B4', '\u25BE');
next_el.style.display = 'block';
next_el.classList.remove('closed');
LS.save(el.id, true);
} else if (toggle || !on) {
el.innerHTML = el.innerHTML.replace('\u25BE', '\u25B4');
next_el.style.display = 'none';
next_el.classList.add('closed');
LS.save(el.id, false);
}
}