Skip to content

Commit

Permalink
deprecate: deprecate "highligth" method in favor of "highlight"
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy authored and mlopezFC committed Jun 25, 2024
1 parent 4c873e5 commit a1db326
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/resources/META-INF/resources/frontend/code-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit a1db326

Please sign in to comment.