Skip to content

Commit 0f54afa

Browse files
committed
fix lint and comment
1 parent 199634a commit 0f54afa

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

web_src/js/markup/codecopy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function makeCodeCopyButton(): HTMLButtonElement {
88
}
99

1010
export function initMarkupCodeCopy(elMarkup: HTMLElement): void {
11-
const el = elMarkup.querySelector('.code-block code') // .markup .code-block code
11+
const el = elMarkup.querySelector('.code-block code'); // .markup .code-block code
1212
if (!el || !el.textContent) return;
1313

1414
const btn = makeCodeCopyButton();

web_src/js/modules/observer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export function registerGlobalEventFunc<T extends HTMLElement, E extends Event>(
2020

2121
// It handles the global init functions by a selector, for example:
2222
// > registerGlobalSelectorObserver('.ui.dropdown:not(.custom)', (el) => { initDropdown(el, ...) });
23+
// ATTENTION: For most cases, it's recommended to use registerGlobalInitFunc instead,
24+
// Because this selector-based approach is less efficient and less maintainable.
25+
// But if there are already a lot of elements on many pages, this selector-based approach is more convenient for exiting code.
2326
export function registerGlobalSelectorFunc(selector: string, handler: (el: HTMLElement) => void) {
2427
selectorHandlers.push({selector, handler});
2528
// Then initAddedElementObserver will call this handler for all existing elements after all handlers are added.

0 commit comments

Comments
 (0)