Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/client/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Home extends Component {

if (query) {
this.activateSearchMode();

this.debouncedSearch();
} else {
this.setState({ searchDocs: this.state.allDocs });
Expand All @@ -261,6 +261,8 @@ class Home extends Component {

search() {
const q = this.state.query;
if( !q ) return;

const waitForFetch = () => this.docSearchFetch;
const doQuery = () => this.docSearch.search(q);

Expand Down Expand Up @@ -324,17 +326,17 @@ class Home extends Component {
let authorNames = authorList.map( a => a.name );
const id = doc.id;
const link = doc.publicUrl;

if( authorNames.length > 3 ){
authorNames = authorNames.slice(0, 2).concat([ '...', authorNames[authorNames.length - 1] ]);
}

const figureDiv = h('div.home-search-doc-figure', {
style: {
backgroundImage: `url('/api/document/${id}.png')`
}
});

return h('div.home-search-doc', [
h('a', {
href: link,
Expand Down