moderator-toolbox-nxg-for-reddit / util/ui/toolboxContainer

util/ui/toolboxContainer

Functions

tagToolboxContainer()

tagToolboxContainer(container, type): void

Defined in: extension/data/util/ui/toolboxContainer.ts:14

Finds the [data-name="toolbox"] marker span inside container and tags it with the toolbox-frontend-container class and a data-toolbox-type attribute, which the toolbox stylesheets key off for per-context layout (e.g. TBcommentAuthor, TBpost). Idempotent: a marker that is already tagged is left untouched.

This replaces the legacy tbReddit CustomEvent round-trip - the dispatch sites now tag their own freshly-injected marker synchronously instead of emitting an event for a listener to handle.

Parameters

container

Element

The element holding the marker span (e.g. a .toolbox-author-slot).

type

string

The toolbox type label written to data-toolbox-type.

Returns

void