From 5628b585fa6356d66cf2e7454be20e3b847ad22e Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 8 Jul 2022 12:37:06 -0400 Subject: fixes for drawing ink on pdf/image/etc. fixes for showing contextMenu. moved gestureOverlay into main dashboard area to avoid drawing on UI widgets. more code cleanup to put things in reasonable places and avoid importing too much stuff. --- src/client/views/collections/TreeView.tsx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/client/views/collections/TreeView.tsx') diff --git a/src/client/views/collections/TreeView.tsx b/src/client/views/collections/TreeView.tsx index eb5faf4e1..5a2103e98 100644 --- a/src/client/views/collections/TreeView.tsx +++ b/src/client/views/collections/TreeView.tsx @@ -31,6 +31,7 @@ import { CollectionTreeView, TreeViewType } from './CollectionTreeView'; import { CollectionView } from './CollectionView'; import './TreeView.scss'; import React = require('react'); +import { ScriptingGlobals } from '../../util/ScriptingGlobals'; export interface TreeViewProps { treeView: CollectionTreeView; @@ -1223,3 +1224,9 @@ export class TreeView extends React.Component { }); } } + +ScriptingGlobals.add(function TreeView_addNewFolder() { + TreeView._editTitleOnLoad = { id: Utils.GenerateGuid(), parent: undefined }; + const opts = { title: 'Untitled folder', _stayInCollection: true, isFolder: true }; + return Doc.AddDocToList(Doc.MyFilesystem, 'data', Docs.Create.TreeDocument([], opts, TreeView._editTitleOnLoad.id)); +}); -- cgit v1.2.3-70-g09d2