Skip to content

Commit

Permalink
feat: replace browser scroll with esl scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
yadamskaya committed Sep 1, 2023
1 parent 337092f commit 11f2935
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/plugins/editor/editor.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.uip-editor {
position: relative;
grid-area: editor;
display: block;
max-height: 325px;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/editor/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export class UIPEditor extends UIPPlugin {
/** Initialize inner {@link https://medv.io/codejar/ Codejar} editor */
protected initEditor(): void {
const codeBlock = (<pre class='language-html editor-content'><code/></pre>) as HTMLPreElement;
this.$inner.classList.add('esl-scrollable-content');
this.$inner.append(<esl-scrollbar target="::parent"></esl-scrollbar> as HTMLElement);
this.$inner.append(codeBlock);

this.editor = new JarEditor(codeBlock, this.editorConfig);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UIPSettings extends UIPPlugin {
const $content = <div className="settings-list esl-scrollable-content">
<esl-scrollbar target="::prev(.settings-list)"></esl-scrollbar>
</div>;
$content.append(...this.childNodes);
$content.append(...this.childNodes);
this.$inner.appendChild($content);
this.appendChild(this.$inner);
}
Expand Down

0 comments on commit 11f2935

Please sign in to comment.