aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-06-09 19:27:47 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-06-09 19:27:47 -0400
commit52f88acb3141e15b1063f489273d94d98447c87a (patch)
tree12290ca3219c19d379f5dce09f7640e08099a5bd /src/client/views
parent2767e06d90eeeb25283d2939208a463f8b52ee6e (diff)
more bugfixing'
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/search/SearchBox.tsx26
-rw-r--r--src/client/views/search/SearchItem.tsx10
2 files changed, 29 insertions, 7 deletions
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index 30d4fd5aa..5ec911221 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -119,9 +119,18 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
if (!_scriptingGlobals.hasOwnProperty("updateIcon")){
Scripting.addGlobal(this.updateIcon);
}
+ if (!_scriptingGlobals.hasOwnProperty("updateTitleStatus")){
+ Scripting.addGlobal(this.updateTitleStatus);
+ }
+ if (!_scriptingGlobals.hasOwnProperty("updateAuthorStatus")){
+ Scripting.addGlobal(this.updateAuthorStatus);
+ }
+ if (!_scriptingGlobals.hasOwnProperty("updateDeletedStatus")){
+ Scripting.addGlobal(this.updateDeletedStatus);
+ }
+
this.resultsScrolled = this.resultsScrolled.bind(this);
- this.rootDoc._viewType = CollectionViewType.Stacking;
new PrefetchProxy(Docs.Create.SearchItemBoxDocument({ title: "search item template",
backgroundColor: "transparent", _xMargin: 5, _height: 46, isTemplateDoc: true, isTemplateForField: "data" }));
@@ -612,6 +621,10 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
if ((this._numTotalResults === 0 || this._results.length === 0) && this._openNoResults) {
this._visibleElements = [<div className="no-result">No Search Results</div>];
//this._visibleDocuments= Docs.Create.
+ let noResult= Docs.Create.TextDocument("",{title:"noResult"})
+ noResult.targetDoc=noResult;
+ noResult.isBucket =false;
+ Doc.AddDocToList(this.dataDoc, this.props.fieldKey, noResult);
return;
}
@@ -893,7 +906,7 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
updateAuthorStatus() { this._authorFieldStatus = !this._authorFieldStatus; }
@action.bound
- updateDataStatus() { this._deletedDocsStatus = !this._deletedDocsStatus; }
+ updateDeletedStatus() { this._deletedDocsStatus = !this._deletedDocsStatus; }
addButtonDoc = (doc: Doc) => Doc.AddDocToList(CurrentUserUtils.UserDocument.expandingButtons as Doc, "data", doc);
remButtonDoc = (doc: Doc) => Doc.RemoveDocFromList(CurrentUserUtils.UserDocument.expandingButtons as Doc, "data", doc);
@@ -1079,10 +1092,10 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
borderRounding: "16px", border:"1px solid grey", color:"white", hovercolor: "rgb(170, 170, 163)", letterSpacing: "2px",
_fontSize: 7,
}))as any as Doc;
- doc.title=button({ title: "Title", onClick:ScriptField.MakeScript("this.updateTitleStatus")});
- doc.deleted=button({ title: "Deleted", onClick:ScriptField.MakeScript(`handleNodeChange()`)});
- doc.author = button({ title: "Author", onClick:ScriptField.MakeScript("this.updateTitleStatus")});
-
+ doc.title=button({ title: "Title", onClick:ScriptField.MakeScript("updateTitleStatus(self)")});
+ doc.deleted=button({ title: "Deleted", onClick:ScriptField.MakeScript("updateDeletedStatus(self)")});
+ doc.author = button({ title: "Author", onClick:ScriptField.MakeScript("updateAuthorStatus(self)")});
+
let buttons = [doc.title as Doc, doc.deleted as Doc, doc.author as Doc];
const dragCreators = Docs.Create.MasonryDocument(buttons, {
@@ -1175,7 +1188,6 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc
height: this.resFull ? "auto" : this.resultHeight,
overflow: "visibile" // this.resFull ? "auto" : "visible"
}} ref={this._resultsRef}>
- {this._visibleElements.length}
</div>
</div>
);
diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx
index 9d5d64dca..74750a40c 100644
--- a/src/client/views/search/SearchItem.tsx
+++ b/src/client/views/search/SearchItem.tsx
@@ -371,6 +371,16 @@ export class SearchItem extends ViewBoxBaseComponent<FieldViewProps, SearchSchem
</button>
</div>
}
+ else if (this.targetDoc.isBucket === false){
+ this.props.Document._chromeStatus='disabled';
+ return <div className="searchItem">
+ <div className="searchItem-body" >
+ <div className="searchItem-title-container">
+ <div className="searchItem-title" style={{height:"10px", overflow:"hidden", textOverflow:"ellipsis"}}>No Search Results</div>
+ </div>
+ </div>
+ </div>
+ }
else {
return <div className="searchItem-overview" onPointerDown={this.pointerDown} onContextMenu={this.onContextMenu}>
<div className="searchItem" onPointerDown={this.nextHighlight} onPointerEnter={this.highlightDoc} onPointerLeave={this.unHighlightDoc}>