ssb: Canceling loads, more mobile-friendly sidebar, and respond to channel subscription changes.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 16m30s

This commit is contained in:
2024-11-30 17:49:27 -05:00
parent 8e0d91dcf5
commit 3ca2b19502
4 changed files with 25 additions and 10 deletions

View File

@ -122,14 +122,10 @@ class TfTabNewsElement extends LitElement {
show_sidebar() {
this.renderRoot.getElementById('sidebar').style.display = 'block';
this.renderRoot.getElementById('main').style.marginLeft = '2in';
this.renderRoot.getElementById('show_sidebar').style.display = 'none';
}
hide_sidebar() {
this.renderRoot.getElementById('sidebar').style.display = 'none';
this.renderRoot.getElementById('main').style.marginLeft = '0';
this.renderRoot.getElementById('show_sidebar').style.display = 'block';
}
async channel_toggle_subscribed() {
@ -176,8 +172,8 @@ class TfTabNewsElement extends LitElement {
</div>`;
}
return html`
<div class="w3-sidebar w3-bar-block w3-theme-d1" style="width: 2in; left: 0" id="sidebar">
<div class="w3-right w3-button" @click=${this.hide_sidebar}>&times;</div>
<div class="w3-sidebar w3-bar-block w3-theme-d1 w3-collapse w3-animate-left" style="width: 2in; left: 0" id="sidebar">
<div class="w3-right w3-button w3-hide-large" @click=${this.hide_sidebar}>&times;</div>
${this.hash.startsWith('##') && this.channels.indexOf(this.hash.substring(2)) == -1 ?
html`
<div class="w3-bar-item w3-theme-d2">Viewing</div>
@ -193,8 +189,8 @@ class TfTabNewsElement extends LitElement {
style=${this.hash == '##' + x ? 'font-weight: bold' : undefined}>#${x} ${this.unread_status(x)}</a>
`)}
</div>
<div style="margin-left: 2in; padding: 8px" id="main">
<div id="show_sidebar" class="w3-left w3-button" style="display: none" @click=${this.show_sidebar}>&#9776;</div>
<div style="margin-left: 2in; padding: 8px" id="main" class="w3-main">
<div id="show_sidebar" class="w3-left w3-button w3-hide-large" @click=${this.show_sidebar}>&#9776;</div>
<p>
<button
class="w3-button w3-theme-d1"