From d6ed6bc7a368169b15b81b02d4daee67a92b05c4 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 30 Aug 2020 00:13:33 -0400 Subject: fixed initialization of non-active tabs. fixed dragging of tab document icon. --- .../collections/CollectionDockingViewMenu.tsx | 3 --- src/client/views/collections/TabDocView.tsx | 27 +++++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionDockingViewMenu.tsx b/src/client/views/collections/CollectionDockingViewMenu.tsx index 4fe97452c..1cab293a8 100644 --- a/src/client/views/collections/CollectionDockingViewMenu.tsx +++ b/src/client/views/collections/CollectionDockingViewMenu.tsx @@ -36,9 +36,6 @@ export class CollectionDockingViewMenu extends React.Component<{ views: () => Do !this._ref.current?.getBoundingClientRect().width && (this._tooltipOpen = true))} onPointerDown={action(e => { - if (getComputedStyle(this._ref.current!).width !== "100%") { - e.stopPropagation(); e.preventDefault(); - } this.props.views()[0]?.select(false); this._tooltipOpen = false; })} > diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx index 36959f254..dd383fc32 100644 --- a/src/client/views/collections/TabDocView.tsx +++ b/src/client/views/collections/TabDocView.tsx @@ -361,19 +361,18 @@ export class TabDocView extends React.Component { } render() { - return !this._isActive ? (null) : - (
{ - if (this._mainCont = ref) { - (this._mainCont as any).InitTab = (tab: any) => this.init(tab, this._document); - DocServer.GetRefField(this.tab.contentItem.config.props.documentId).then(action(doc => doc instanceof Doc && (this._document = doc) && this.init(this.tab, this._document))); - } - }} - style={{ - transform: `translate(${this.previewPanelCenteringOffset}px, 0px)`, - height: this.layoutDoc?._fitWidth ? undefined : "100%", - width: this.widthpercent - }}> - {this.docView} -
); + return (
{ + if (this._mainCont = ref) { + (this._mainCont as any).InitTab = (tab: any) => this.init(tab, this._document); + this.tab && DocServer.GetRefField(this.tab.contentItem.config.props.documentId).then(action(doc => doc instanceof Doc && (this._document = doc) && this.init(this.tab, this._document))); + } + }} + style={{ + transform: `translate(${this.previewPanelCenteringOffset}px, 0px)`, + height: this.layoutDoc?._fitWidth ? undefined : "100%", + width: this.widthpercent + }}> + {this.docView} +
); } } -- cgit v1.2.3-70-g09d2