better sizing of search pane

This commit is contained in:
azivner 2018-06-04 20:22:41 -04:00
parent 015cd68756
commit 5a1938c078
3 changed files with 24 additions and 16 deletions

View File

@ -166,11 +166,27 @@ div.ui-tooltip {
#tree {
overflow: auto;
flex-grow: 100;
flex-shrink: 100;
flex-grow: 1;
flex-shrink: 1;
flex-basis: 60%;
margin-top: 10px;
}
#search-results {
padding: 0 5px 5px 15px;
flex-basis: 40%;
flex-grow: 1;
flex-shrink: 1;
margin-top: 10px;
display: none;
overflow: auto;
border-bottom: 2px solid #ddd;
}
#search-results ul {
padding: 5px 5px 5px 15px;
}
/*
* .electron-in-page-search-window is a class specified to default
* <webview> element for search window.
@ -366,12 +382,4 @@ div.ui-tooltip {
#note-path-list .current a {
font-weight: bold;
}
#search-results {
padding: 0 5px 5px 15px;
}
#search-results ul {
padding: 5px 5px 5px 15px;
}

View File

@ -63,7 +63,7 @@ function findNotes(query) {
continue;
}
const title = getNoteTitleForParent(noteId, parentNoteId).toLowerCase();
const title = getNoteTitle(noteId, parentNoteId).toLowerCase();
const foundTokens = [];
for (const token of tokens) {
@ -116,7 +116,7 @@ function search(noteId, tokens, path, results) {
continue;
}
const title = getNoteTitleForParent(noteId, parentNoteId);
const title = getNoteTitle(noteId, parentNoteId);
const foundTokens = [];
for (const token of tokens) {
@ -136,7 +136,7 @@ function search(noteId, tokens, path, results) {
}
}
function getNoteTitleForParent(noteId, parentNoteId) {
function getNoteTitle(noteId, parentNoteId) {
const prefix = prefixes[noteId + '-' + parentNoteId];
let title = noteTitles[noteId];
@ -159,7 +159,7 @@ function getNoteTitleForPath(path) {
let parentNoteId = 'root';
for (const noteId of path) {
const title = getNoteTitleForParent(noteId, parentNoteId);
const title = getNoteTitle(noteId, parentNoteId);
titles.push(title);
parentNoteId = noteId;

View File

@ -81,7 +81,7 @@
</div>
</div>
<div id="search-results" style="flex-shrink: 10; flex-grow: 10; margin-top: 10px; display: none; overflow: auto; border-bottom: 2px solid #ddd">
<div id="search-results">
<strong>Search results:</strong>
<ul id="search-results-inner">
@ -91,7 +91,7 @@
</ul>
</div>
<div id="tree" style="flex-shrink: 10; flex-grow: 10;"></div>
<div id="tree"></div>
</div>
<div style="grid-area: title;">