mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
web: Use util.the for accessing element of single-item lists.
This commit is contained in:
@@ -312,7 +312,7 @@ export const update_elements = ($content: JQuery): void => {
|
||||
$view_in_playground_button.attr("aria-label", title);
|
||||
}
|
||||
const $copy_button = $buttonContainer.find(".copy_codeblock");
|
||||
const clipboard = new ClipboardJS($copy_button[0]!, {
|
||||
const clipboard = new ClipboardJS(util.the($copy_button), {
|
||||
text(copy_element) {
|
||||
const $code = $(copy_element).parent().siblings("code");
|
||||
return $code.text();
|
||||
@@ -320,7 +320,7 @@ export const update_elements = ($content: JQuery): void => {
|
||||
});
|
||||
|
||||
clipboard.on("success", () => {
|
||||
show_copied_confirmation($copy_button[0]!);
|
||||
show_copied_confirmation(util.the($copy_button));
|
||||
});
|
||||
$codehilite.addClass("zulip-code-block");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user