calorie entry / save on same line
This commit is contained in:
parent
132ce9ae5b
commit
304336a4a2
|
@ -27,3 +27,9 @@
|
||||||
.collection-item:hover {background: #EEE}
|
.collection-item:hover {background: #EEE}
|
||||||
|
|
||||||
.datepicker-day-button {color: #000}
|
.datepicker-day-button {color: #000}
|
||||||
|
|
||||||
|
input::-webkit-outer-spin-button,
|
||||||
|
input::-webkit-inner-spin-button {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
|
@ -58,14 +58,13 @@
|
||||||
<section>
|
<section>
|
||||||
<form id="entry" action="">
|
<form id="entry" action="">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s8">
|
<div class="col s8" style="padding-left: 2rem">
|
||||||
<label for="">Name</label>
|
|
||||||
<input type="text" id="name" placeholder="Item Description (optional)">
|
|
||||||
</div>
|
|
||||||
<div class="col s4">
|
|
||||||
<label for="">Calories</label>
|
<label for="">Calories</label>
|
||||||
<input type="number" id="calories" placeholder="Item Calories" @keyup="search">
|
<input type="number" id="calories" placeholder="Item Calories" @keyup="search">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col s4 center" style="line-height: 72px;">
|
||||||
|
<button class="btn green" @click="save" style="margin-bottom:-12px">Add Calories</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :if="this.choices.length" class="collection ">
|
<div :if="this.choices.length" class="collection ">
|
||||||
<div :for="item, i in this.choices" class="row collection-item" idx="{i}">
|
<div :for="item, i in this.choices" class="row collection-item" idx="{i}">
|
||||||
|
@ -79,11 +78,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="col right">
|
|
||||||
<button class="btn green" @click="save">Add Calories</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,6 @@ Litedom({
|
||||||
save() {
|
save() {
|
||||||
// capture quick form entry
|
// capture quick form entry
|
||||||
let calories = document.getElementById('calories');
|
let calories = document.getElementById('calories');
|
||||||
let name = document.getElementById('name');
|
|
||||||
|
|
||||||
// source of calories
|
// source of calories
|
||||||
let source = (calories) => {
|
let source = (calories) => {
|
||||||
|
@ -126,7 +125,7 @@ Litedom({
|
||||||
|
|
||||||
// add new entry
|
// add new entry
|
||||||
db.entries.add({
|
db.entries.add({
|
||||||
name: String(name.value),
|
name: '',
|
||||||
target: 'calorie',
|
target: 'calorie',
|
||||||
type: source(calories),
|
type: source(calories),
|
||||||
value: Number(calories.value),
|
value: Number(calories.value),
|
||||||
|
|
Loading…
Reference in New Issue