From 8b1a47dd539581cf0328d1f310c318e76550005e Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:29:35 -0300 Subject: [PATCH] deprecate: deprecate "highligth" method in favor of "highlight" --- .../resources/META-INF/resources/frontend/code-viewer.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/resources/META-INF/resources/frontend/code-viewer.ts b/src/main/resources/META-INF/resources/frontend/code-viewer.ts index 1c8d5e6..9d71a75 100644 --- a/src/main/resources/META-INF/resources/frontend/code-viewer.ts +++ b/src/main/resources/META-INF/resources/frontend/code-viewer.ts @@ -31,7 +31,7 @@ import "./prism.js"; //highlight a marked block in the single code-viewer of the UI highlight: (id:string|null) => { const viewer = document.querySelector("code-viewer") as CodeViewer; - if (viewer) viewer.highligth(id); + if (viewer) viewer.highlight(id); }, //highlight a marked block in the single code-viewer of the UI, on hover of element @@ -434,8 +434,13 @@ pre[class*="language-"] { } - //highligth a marked block + /** @deprecated Use highlight(id: string|null) instead */ highligth(id:string|null) { + this.highlight(id); + } + + //highlight a marked block + highlight(id:string|null) { const div = this.querySelector('.highlight') as HTMLElement; div.style.removeProperty('top');