diff options
author | geireann <60007097+geireann@users.noreply.github.com> | 2020-11-03 11:12:29 +0800 |
---|---|---|
committer | geireann <60007097+geireann@users.noreply.github.com> | 2020-11-03 11:12:29 +0800 |
commit | c0d63fed441650d38e56d04e920f94ff1b6a3134 (patch) | |
tree | 5a1869e5c2f2402048b006875383a1ab15ac0cd9 | |
parent | 5ed05b89fbe1b5ccc34dfd342098bd1e6ac3935c (diff) |
get pres width differently
-rw-r--r-- | src/client/views/presentationview/PresElementBox.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index b2acad86e..0e10cce47 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -273,9 +273,8 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps, PresDoc @computed get toolbarWidth(): number { const presBoxDocView = DocumentManager.Instance.getDocumentView(this.presBox); - let width: number = NumCast(this.presBox._width); - if (presBoxDocView) width = presBoxDocView.props.PanelWidth(); - return width; + const panelWidth = presBoxDocView ? presBoxDocView.props.PanelWidth() : 0; + return Math.max(NumCast(this.presBox._width), panelWidth); } @computed get mainItem() { |