aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/util/CurrentUserUtils.ts14
-rw-r--r--src/client/views/EditableView.tsx1
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx1
3 files changed, 12 insertions, 4 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 6a7523d5b..d5dc9e2be 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -38,6 +38,7 @@ import { ColorScheme } from "./SettingsManager";
import { SharingManager } from "./SharingManager";
import { SnappingManager } from "./SnappingManager";
import { UndoManager } from "./UndoManager";
+import { TreeView } from "../views/collections/TreeView";
interface Button {
title?: string;
@@ -853,8 +854,12 @@ export class CurrentUserUtils {
if (doc.myFilesystem === undefined) {
doc.myFileOrphans = Docs.Create.TreeDocument([], { title: "Unfiled", _stayInCollection: true, system: true, isFolder: true });
// doc.myFileRoot = Docs.Create.TreeDocument([], { title: "file root", _stayInCollection: true, system: true, isFolder: true });
- const newFolder = ScriptField.MakeFunction(`doc.makeFolder()`, { doc: doc.myFilesystem })!;
- const newFolderButton: Doc = Docs.Create.FontIconDocument({ onClick: newFolder, _forceActive: true, toolTip: "Create new folder", _stayInCollection: true, _hideContextMenu: true, title: "New folder", btnType: ButtonType.ClickButton, _width: 30, _height: 30, buttonText: "New folder", icon: "folder-plus", system: true });
+ const newFolder = ScriptField.MakeFunction(`makeTopLevelFolder()`, { scriptContext: "any" })!;
+ const newFolderButton: Doc = Docs.Create.FontIconDocument({
+ onClick: newFolder, _forceActive: true, toolTip: "Create new folder",
+ _stayInCollection: true, _hideContextMenu: true, title: "New folder", btnType: ButtonType.ClickButton, _width: 30, _height: 30,
+ buttonText: "New folder", icon: "folder-plus", system: true
+ });
doc.myFilesystem = new PrefetchProxy(Docs.Create.TreeDocument([doc.myFileOrphans as Doc], {
title: "My Documents", _showTitle: "title", buttonMenu: true, buttonMenuDoc: newFolderButton, _height: 100,
treeViewHideTitle: true, _xMargin: 5, _yMargin: 5, _gridGap: 5, _forceActive: true, childDropAction: "alias",
@@ -1628,3 +1633,8 @@ Scripting.addGlobal(function selectedDocumentType(docType?: DocumentType, colTyp
else if (selected && !colType && !docType) return false;
else return true;
});
+Scripting.addGlobal(function makeTopLevelFolder() {
+ const folder = Docs.Create.TreeDocument([], { title: "Untitled folder", _stayInCollection: true, isFolder: true });
+ TreeView._editTitleOnLoad = { id: folder[Id], parent: undefined };
+ return Doc.AddDocToList(Doc.UserDoc().myFilesystem as Doc, "data", folder);
+}); \ No newline at end of file
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx
index ebf5ca82d..d7707a6fe 100644
--- a/src/client/views/EditableView.tsx
+++ b/src/client/views/EditableView.tsx
@@ -158,7 +158,6 @@ export class EditableView extends React.Component<EditableProps> {
renderEditor() {
- console.log("render editor", this.props.autosuggestProps);
return this.props.autosuggestProps
? <Autosuggest
{...this.props.autosuggestProps.autosuggestProps}
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 540bfd1ef..648ff5087 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -575,7 +575,6 @@ export class CollectionStackingView extends CollectionSubView<StackingDocument,
};
const buttonMenu = this.rootDoc.buttonMenu;
const noviceExplainer = this.rootDoc.explainer;
- console.log(noviceExplainer);
return (
<>
{buttonMenu || noviceExplainer ? <div className="documentButtonMenu">