fix: latex editor max-height (#12520)
Closes: BS-3538 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Improved click handling for LaTeX blocks, making interactions more consistent and maintainable. - Updated LaTeX editor menu layout to enhance vertical scrolling, ensuring better usability with large content. - **Style** - Added a maximum height and vertical scrolling to the LaTeX editor for improved user experience with lengthy formulas. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -74,19 +74,16 @@ export class LatexBlockComponent extends CaptionedBlockComponent<LatexBlockModel
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
this.disposables.addFromEvent(this, 'click', () => {
|
||||
// should not open editor or select block in readonly mode
|
||||
if (this.store.readonly) {
|
||||
return;
|
||||
}
|
||||
private _handleClick() {
|
||||
if (this.store.readonly) return;
|
||||
|
||||
if (this.isBlockSelected) {
|
||||
this.toggleEditor();
|
||||
} else {
|
||||
this.selectBlock();
|
||||
}
|
||||
});
|
||||
if (this.isBlockSelected) {
|
||||
this.toggleEditor();
|
||||
} else {
|
||||
this.selectBlock();
|
||||
}
|
||||
}
|
||||
|
||||
removeEditor(portal: HTMLDivElement) {
|
||||
@@ -95,7 +92,11 @@ export class LatexBlockComponent extends CaptionedBlockComponent<LatexBlockModel
|
||||
|
||||
override renderBlock() {
|
||||
return html`
|
||||
<div contenteditable="false" class="latex-block-container">
|
||||
<div
|
||||
contenteditable="false"
|
||||
class="latex-block-container"
|
||||
@click=${this._handleClick}
|
||||
>
|
||||
<div class="katex"></div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user