From 1107c4eaeb3291c37ff3c6fb045aab3dbc4cc3c8 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 3 Aug 2020 12:03:00 -0400 Subject: removed some items from collectionMenu in novicemode. --- src/client/views/collections/CollectionMenu.tsx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index 660b9f4df..a7d2c07fa 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -186,12 +186,11 @@ export class CollectionViewBaseChrome extends React.Component { - this._currentKey = this._currentKey || (this._buttonizableCommands.length ? this._buttonizableCommands[0]?.title : ""); + this._currentKey = this._currentKey || (this._buttonizableCommands?.length ? this._buttonizableCommands[0]?.title : ""); }); @undoBatch @@ -261,7 +260,7 @@ export class CollectionViewBaseChrome extends React.Component c.title === this._currentKey).map(c => c.immediate(docDragData.draggedDocuments || [])); + this._buttonizableCommands?.filter(c => c.title === this._currentKey).map(c => c.immediate(docDragData.draggedDocuments || [])); e.stopPropagation(); } return true; @@ -283,12 +282,12 @@ export class CollectionViewBaseChrome extends React.Component { setupMoveUpEvents(this, e, (e, down, delta) => { - this._buttonizableCommands.filter(c => c.title === this._currentKey).map(c => + this._buttonizableCommands?.filter(c => c.title === this._currentKey).map(c => DragManager.StartButtonDrag([this._commandRef.current!], c.script, c.title, { target: this.document }, c.params, c.initialize, e.clientX, e.clientY)); return true; }, emptyFunction, () => { - this._buttonizableCommands.filter(c => c.title === this._currentKey).map(c => c.immediate([])); + this._buttonizableCommands?.filter(c => c.title === this._currentKey).map(c => c.immediate([])); }); } @@ -302,7 +301,7 @@ export class CollectionViewBaseChrome extends React.Component )} @@ -359,7 +358,7 @@ export class CollectionViewBaseChrome extends React.Component
{this.notACollection || this.props.type === CollectionViewType.Invalid ? (null) : this.viewModes} - {this.notACollection && Doc.UserDoc().noviceMode ? (null) : this.templateChrome} + {!this._buttonizableCommands ? (null) : this.templateChrome} {Doc.UserDoc().noviceMode ? (null) : filter documents to show
} placement="bottom">
-- cgit v1.2.3-70-g09d2