Skip to content

[3.0] Theme split (wave 4, part 16) — drop the group membership highlight, which highlights nothing - #9437

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

[3.0] Theme split (wave 4, part 16) — drop the group membership highlight, which highlights nothing#9437
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-groupmembership-script

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part of the #7933 split, wave 4.
Profile area.

Profile → Group Membership attaches a handler to every primary-group radio:

onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');"

which runs:

prevDiv.className = prevClass;       // put the last one back
prevDiv = document.getElementById(box);
prevClass = prevDiv.className;
prevDiv.className = "windowbg";      // and set this one to…

Every row in that list is emitted as <div class="windowbg" id="primdiv_N">, so the last
line sets the class it already has. The function has never changed anything on the page. It
reads like a leftover from when the rows alternated between two classes — the striping is
CSS now.

The theme branch deletes it and adds nothing in its place, which is what this does.
id="primdiv_N" stays on the rows, as it does there.

Checked

On release-3.0, clicking each enabled radio in turn:

class background
primdiv_1 windowbg rgb(240, 244, 247)
primdiv_2 windowbg rgb(253, 253, 253)
primdiv_0 windowbg rgb(240, 244, 247)

Same three rows, same two values, before any click and after every one of them — and the
same again with this applied. The radios still select, and nothing else on the page reads
highlightSelected, prevDiv or prevClass.

(The area needs show_group_membership on, your own profile, and two groups that can be
primary, or it does not render at all.)

Issues References (Fixes|Related|Closes)

Part of #7933

Co-Authored-By: live627 john@jbrock.us

Picking a primary group ran highlightSelected(), which saved the row's
class, put it back, and then set the row to "windowbg". Every row in that
list is already "windowbg", so the function has never changed anything.
It reads like a leftover from when the rows alternated between two
classes; the striping comes from CSS now.

Clicking through every radio on release-3.0 leaves all three rows at
class="windowbg" with the background they started with, which is what
happens without the script as well.

Signed-off-by: Mathias Alberts <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 9, 2026
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