Skip to content

[3.0] Theme split (wave 4, part 14) — make the search board picker a disclosure widget - #9432

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-search-boards
Open

[3.0] Theme split (wave 4, part 14) — make the search board picker a disclosure widget#9432
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-search-boards

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part of the #7933 split (wave 4, part 14). Search area.

The panel that chooses which boards to search was a title bar, a link, a hidden
arrow and a div, wired together by an smc_Toggle generated into the page. That
is what a <details> element does on its own, so it is one now, and the ~25
lines of script go with it.

Worth having beyond the tidy-up: the old control was an <a href="#"> whose only
behaviour came from the script, so the panel could not be opened by keyboard in
any sensible way, and did not open at all without JavaScript. A <summary> does
both.

On the one CSS rule

The two bar classes end up on a single element now (<summary class="title_bar titlebg"> rather than a div.title_bar wrapping an h4.titlebg). .titlebg
comes later in index.css and sets background: none, so the bar's own
background is named again in a rule for the summary. That rule also puts
overflow back to visible, because .titlebg hides it and would otherwise
clip the disclosure triangle away.

Testing

Computed styles compared against release-3.0:

release-3.0 this branch
background rgb(255, 255, 255) rgb(255, 255, 255)
background-image none none
colour rgb(85, 85, 85) rgb(85, 85, 85)
padding 6px 12px 5px 6px 12px 5px
border-top 1.71429px rgb(255, 148, 0) 1.71429px rgb(255, 148, 0)
font 700 Tahoma, sans-serif 700 Tahoma, sans-serif
height / width / left 34 / 729 / 91 34 / 729 / 91

The panel still starts closed when every board is selected, opening it reveals
the list, the per-category selectBoards() links still work, and a search run
with the picker open submits its brd[] values and returns results.

Noticed while testing, not fixed here

?action=search;topic=N without a board in the URL is a 500 on release-3.0
as well — Typed property SMF\Board::$id must not be accessed before initialization, the same shape as #9413. Untouched by this branch; worth its own
fix.

Issues References (Fixes|Related|Closes)

Related to #7933

The panel that chooses which boards to search was a title bar, a link, a hidden
arrow and a div, wired together by an smc_Toggle generated into the page. All of
that is what a details element does on its own, so it is one now, and the ~25
lines of script go away with it.

Worth having beyond the tidy-up: the old link was an <a href="#"> whose only
behaviour came from the script, so the panel could not be opened by keyboard in
any sensible way and did not open at all without JavaScript. A summary does
both.

The two bar classes end up on the one element, and since .titlebg comes later in
index.css with a background of its own, the bar's background is named again in a
rule for the summary. That rule also has to put overflow back to visible,
because .titlebg hides it and would clip the disclosure triangle away.

Verified against release-3.0 with computed styles: background, background-image,
colour, padding, border, font weight, font family and the bar's height, width
and position are all identical, the panel still starts closed when every board is
selected, and a search with the picker open still submits its brd[] values and
returns results.

Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants