calorie entry / save on same line

This commit is contained in:
Geoff Doty 2020-09-29 01:25:27 -04:00
parent 132ce9ae5b
commit 304336a4a2
3 changed files with 11 additions and 12 deletions

View File

@ -27,3 +27,9 @@
.collection-item:hover {background: #EEE}
.datepicker-day-button {color: #000}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

View File

@ -58,14 +58,13 @@
<section>
<form id="entry" action="">
<div class="row">
<div class="col s8">
<label for="">Name</label>
<input type="text" id="name" placeholder="Item Description (optional)">
</div>
<div class="col s4">
<div class="col s8" style="padding-left: 2rem">
<label for="">Calories</label>
<input type="number" id="calories" placeholder="Item Calories" @keyup="search">
</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 :if="this.choices.length" class="collection ">
<div :for="item, i in this.choices" class="row collection-item" idx="{i}">
@ -79,11 +78,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col right">
<button class="btn green" @click="save">Add Calories</button>
</div>
</div>
</form>
</section>

View File

@ -111,7 +111,6 @@ Litedom({
save() {
// capture quick form entry
let calories = document.getElementById('calories');
let name = document.getElementById('name');
// source of calories
let source = (calories) => {
@ -126,7 +125,7 @@ Litedom({
// add new entry
db.entries.add({
name: String(name.value),
name: '',
target: 'calorie',
type: source(calories),
value: Number(calories.value),