diff --git a/src/ncounter/App.svelte b/src/ncounter/App.svelte index 7384304..e68caec 100644 --- a/src/ncounter/App.svelte +++ b/src/ncounter/App.svelte @@ -8,9 +8,9 @@
- + - +
@@ -28,15 +28,11 @@ function focus(node){ node.focus(); } -function save(counter){ - alert('Save ' + counter.title); -} - function showAdd(){ newCounter = { title: '', - value: 0, - isClickCounter: false, + initialValue: 0, + saveHistory: false, history: [] } @@ -44,7 +40,12 @@ function showAdd(){ } function add(){ - counters.add(newCounter); + const counter = { + ...newCounter, + value: newCounter.initialValue + } + + counters.add(counter); showAddDialog = false; } @@ -67,16 +68,6 @@ function add(){ color: white; } - .dialog-content > label { - display: flex; - width: 100%; - margin-bottom: 5px; - } - - .dialog-content > label > input { - margin-left: auto; - } - .ok { margin-left: auto; } diff --git a/src/ncounter/Counter.svelte b/src/ncounter/Counter.svelte index 256abed..7f88945 100644 --- a/src/ncounter/Counter.svelte +++ b/src/ncounter/Counter.svelte @@ -1,20 +1,17 @@ -
+
{ counter.title }
{ counter.value } {#if counter.max} {/if}
- {#if !counter.isClickCounter} - - {/if} - { message } + - +
- {#if showDialog} + {#if showValueDialog}

{ showIncrement ? "Add" : "Set" }

@@ -23,7 +20,19 @@
- {/if} + {/if} + {#if showEditDialog} +
+
+ + + + + + +
+
+ {/if}