aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/MainView.tsx10
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx10
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx2
-rw-r--r--src/fields/Doc.ts5
4 files changed, 17 insertions, 10 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 6db518f1e..7c7c5b72b 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -56,6 +56,7 @@ import { PreviewCursor } from './PreviewCursor';
import { PropertiesView } from './PropertiesView';
import { SearchBox } from './search/SearchBox';
import { TraceMobx } from '../../fields/util';
+import { SelectionManager } from '../util/SelectionManager';
const _global = (window /* browser */ || global /* node */) as any;
@observer
@@ -519,12 +520,18 @@ export class MainView extends React.Component {
</defs>
</svg>;
}
+ select = (ctrlPressed: boolean) => { SelectionManager.SelectDoc(this, ctrlPressed); };
@computed get search() {
TraceMobx();
return <div className="mainView-searchPanel">
- <DocumentView Document={CurrentUserUtils.MySearchPanelDoc}
+ <SearchBox Document={CurrentUserUtils.MySearchPanelDoc}
DataDoc={undefined}
+ fieldKey="data"
+ dropAction="move"
+ isSelected={returnTrue}
+ active={returnTrue}
+ select={this.select}
LibraryPath={emptyPath}
addDocument={undefined}
addDocTab={this.addDocTabFunc}
@@ -541,7 +548,6 @@ export class MainView extends React.Component {
PanelHeight={this.getPHeight}
renderDepth={0}
focus={emptyFunction}
- parentActive={returnTrue}
whenActiveChanged={emptyFunction}
bringToFront={emptyFunction}
docFilters={returnEmptyFilter}
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index d39ef5e80..a3d58f31d 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -173,7 +173,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
rowlayout.config.height = 50;
newContentItem.config.height = 50;
}
- } else if (instance._goldenLayout.root.contentItems[0].isColumn) { // if column
+ } else {// if (instance._goldenLayout.root.contentItems[0].isColumn) { // if column
switch (pullSide) {
case "top": instance._goldenLayout.root.contentItems[0].addChild(newContentItem, 0); break;
case "bottom": instance._goldenLayout.root.contentItems[0].addChild(newContentItem); break;
@@ -360,8 +360,8 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
}
stackCreated = (stack: any) => {
- stack.header.element.on('mousedown', (e: any) => {
- if (e.target === stack.header.element[0] && e.button === 2) {
+ stack.header?.element.on('mousedown', (e: any) => {
+ if (e.target === stack.header?.element[0] && e.button === 2) {
const emptyPane = CurrentUserUtils.EmptyPane;
emptyPane["dragFactory-count"] = NumCast(emptyPane["dragFactory-count"]) + 1;
CollectionDockingView.AddSplit(Docs.Create.FreeformDocument([], {
@@ -370,14 +370,14 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
}
});
- stack.header.controlsContainer.find('.lm_close') //get the close icon
+ stack.header?.controlsContainer.find('.lm_close') //get the close icon
.off('click') //unbind the current click handler
.click(action(() => {
//if (confirm('really close this?')) {
stack.remove();
stack.contentItems.forEach((contentItem: any) => Doc.AddDocToList(CurrentUserUtils.MyRecentlyClosed, "data", contentItem.tab.DashDoc, undefined, true, true));
}));
- stack.header.controlsContainer.find('.lm_popout') //get the close icon
+ stack.header?.controlsContainer.find('.lm_popout') //get the close icon
.off('click') //unbind the current click handler
.click(action(() => {
// stack.config.fixed = !stack.config.fixed; // force the stack to have a fixed size
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index c49e38f72..436538eba 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -499,7 +499,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
if (node.isTextblock) {
let index = 0, foundAt;
const ep = this.getNodeEndpoints(pm.state.doc, node);
- const regexp = find.replace("*", "");
+ const regexp = new RegExp(find.replace("*", ""), "i");
if (regexp) {
while (ep && (foundAt = node.textContent.slice(index).search(regexp)) > -1) {
const sel = new TextSelection(pm.state.doc.resolve(ep.from + index + foundAt + 1), pm.state.doc.resolve(ep.from + index + foundAt + find.length + 1));
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index a4fcfce5e..bc31c1a21 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -922,8 +922,9 @@ export namespace Doc {
brushManager.SearchMatchDoc.has(Doc.GetProto(doc)) ? brushManager.SearchMatchDoc.get(Doc.GetProto(doc)) : undefined;
}
export function SetSearchMatch(doc: Doc, results: { searchMatch: number }) {
- if (!doc || GetEffectiveAcl(doc) === AclPrivate || GetEffectiveAcl(Doc.GetProto(doc)) === AclPrivate) return doc;
- brushManager.SearchMatchDoc.set(doc, results);
+ if (doc && GetEffectiveAcl(doc) !== AclPrivate && GetEffectiveAcl(Doc.GetProto(doc)) !== AclPrivate) {
+ brushManager.SearchMatchDoc.set(doc, results);
+ }
return doc;
}
export function SearchMatchNext(doc: Doc, backward: boolean) {