mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add estimated height to some block widget decorations (#16485)
GitOrigin-RevId: f59da18228e038b1295ccc0128a33acd2de4f9f9
This commit is contained in:
parent
6b3a953c8d
commit
4bca3de8d2
3 changed files with 10 additions and 2 deletions
|
@ -21,7 +21,7 @@ export class EndDocumentWidget extends WidgetType {
|
|||
return true
|
||||
}
|
||||
|
||||
updateDOM(): boolean {
|
||||
return true
|
||||
get estimatedHeight() {
|
||||
return 30
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,10 @@ export class PreambleWidget extends WidgetType {
|
|||
return this.expanded === other.expanded
|
||||
}
|
||||
|
||||
get estimatedHeight() {
|
||||
return this.expanded ? -1 : 54
|
||||
}
|
||||
|
||||
getToggleText(view: EditorView) {
|
||||
if (this.expanded) {
|
||||
return view.state.phrase(`hide_document_preamble`)
|
||||
|
|
|
@ -59,6 +59,10 @@ export class TabularWidget extends WidgetType {
|
|||
return true
|
||||
}
|
||||
|
||||
get estimatedHeight() {
|
||||
return this.parsedTableData.table.rows.length * 50
|
||||
}
|
||||
|
||||
destroy(element: HTMLElement) {
|
||||
ReactDOM.unmountComponentAtNode(element)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue