Skip to content

Commit

Permalink
mobile viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
steskelt committed Mar 19, 2024
1 parent 6e937f0 commit df681b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions _pages/rankings.html
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,12 @@ <h5 class="card-title">${this.profileTitle(item)}</h5>
}

renderStocks() {
const toolbarItemCount = Math.min(Math.floor((screen.availWidth - 50) / 85) - 1, StockToolbar.maxToolbarItems);
const staticitems = this.stocks.slice(0, toolbarItemCount);
const selectedDropDown = (this.selectedStockItem == null || staticitems.findIndex(o => o.symbol == this.selectedStockItem.symbol) > -1)? null : this.selectedStockItem;
const toolbarItemCount = Math.min(Math.floor((screen.availWidth - 50 - 40) / 85), StockToolbar.maxToolbarItems);
const searchWidth = toolbarItemCount == StockToolbar.maxToolbarItems ? '65px' : '40px';
const stockSymbols = this.stocks.slice(0, toolbarItemCount);
const selectedDropDown = (this.selectedStockItem == null || stockSymbols.findIndex(o => o.symbol == this.selectedStockItem.symbol) > -1)? null : this.selectedStockItem;
return html`
${staticitems.map(
${stockSymbols.map(
(item) => html`
<button
@click=${() => this.toggleSelected(item)}
Expand Down Expand Up @@ -438,7 +439,7 @@ <h5 class="card-title">${this.profileTitle(item)}</h5>
<button
@click=${this.toggleDropdown} id="testbtn"
class="btn btn-outline-secondary ${selectedDropDown == null ? '' : 'active'}" type="button"
title="${selectedDropDown == null ? "Select Stock" : selectedDropDown.name}" data-bs-toggle="tooltip" data-bs-placement="top" style="width:65pt"
title="${selectedDropDown == null ? "Select Stock" : selectedDropDown.name}" data-bs-toggle="tooltip" data-bs-placement="top" style="width:${searchWidth}"
>
${selectedDropDown == null ? "🔍" : selectedDropDown.symbol}
</button>
Expand Down

0 comments on commit df681b8

Please sign in to comment.