diff --git a/index.html b/index.html index 5769ebc..72d09d8 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,8 @@ + + diff --git a/src/lib/NoteDetail.svelte b/src/lib/NoteDetail.svelte index 1c053fd..ad16b16 100644 --- a/src/lib/NoteDetail.svelte +++ b/src/lib/NoteDetail.svelte @@ -3,7 +3,7 @@ import { onMount } from 'svelte'; import { RxDBUpdatePlugin } from 'rxdb/plugins/update'; - import { selectedNote, bodyText } from './store'; + import { db, selectedNote, bodyText } from './store'; import { debounce } from '../utils/debounce'; import { isEmptyObject } from '../utils/isEmptyObject'; @@ -11,10 +11,12 @@ import Settings from './Settings.svelte'; let innerHeight; + let db$; - onMount(() => { + onMount(async () => { addRxPlugin(RxDBUpdatePlugin); - if ($selectedNote.body) $bodyText = $selectedNote.body; + db$ = await db(); + db$.notes.findOne($selectedNote.guid).exec(); }); const handleDebounceSave = debounce(() => !isEmptyObject($selectedNote) && updateNote(), 500); @@ -31,7 +33,7 @@ -
+
{#if isEmptyObject($selectedNote)}

No Note Selected

diff --git a/src/lib/NoteList.svelte b/src/lib/NoteList.svelte index 22b8e9e..4652016 100644 --- a/src/lib/NoteList.svelte +++ b/src/lib/NoteList.svelte @@ -68,7 +68,7 @@ id="noteList" on:mousedown={() => (isMouseDown = true)} on:mouseup={() => (isMouseDown = false)} - style="height: {$noteListHeight}px" + style="height: {$noteListHeight}px;" > {#await noteList} Loading Notes... @@ -110,7 +110,7 @@ width: 100%; overflow-y: auto; overflow-x: hidden; - background-color: #1c1f21; + background-color: var(--app-omni-background); border-top-left-radius: 8px; border-top-right-radius: 8px; } @@ -127,10 +127,10 @@ color: rgb(205, 205, 205); } li:nth-child(odd) { - background: #2b2e31; + background: var(--app-notelist-odd-background); } li:nth-child(even) { - background: #222426; + background: var(--app-notelist-even-background); } .meta { color: #43484f; diff --git a/src/lib/OmniBar.svelte b/src/lib/OmniBar.svelte index d3218d5..8f7a2ab 100644 --- a/src/lib/OmniBar.svelte +++ b/src/lib/OmniBar.svelte @@ -43,7 +43,7 @@
import { noteListHeight } from './store'; - import mousePosition from '../utils/mousePosition'; let dragging = false; + let start, initial = null; + let y; - const startResize = () => (dragging = true); - const stopResize = () => (dragging = false); + $: height = 100; - const handleResize = () => { + // const startResize = () => (dragging = true); + const startResize = (type, event) => { + event.preventDefault(); + dragging = true; + start = event.pageY; + initial = { y, height }; + }; + + // const stopResize = () => (dragging = false); + const stopResize = () => { + dragging = false; + start = null; + initial = null; + }; + + const handleResize = (event) => { + event.preventDefault(); if (!dragging) return; - $noteListHeight = $mousePosition.y >= 42 && $mousePosition.y - 42; - // TODO now check for page size and never allow the resize bar to go past the floor! + const delta = start - event.pageY; + height = initial.height - delta; + $noteListHeight = height; return; }; - +
diff --git a/src/lib/Settings.svelte b/src/lib/Settings.svelte index 296f908..8cf2489 100644 --- a/src/lib/Settings.svelte +++ b/src/lib/Settings.svelte @@ -1,5 +1,5 @@ -
-

nvAux Settings

+
+ nvAux Settings
{#await db().notes.find().exec()}

...waiting

@@ -28,7 +28,10 @@

General Preferences

- + +
+
+

Import/Export Notes

diff --git a/src/lib/StatusBar.svelte b/src/lib/StatusBar.svelte index 0739e1e..d0f776c 100644 --- a/src/lib/StatusBar.svelte +++ b/src/lib/StatusBar.svelte @@ -1,7 +1,7 @@