...
 
Commits (3)
{}
{
"projects": {
"default": "shoppinglist-db187"
}
}
......@@ -72,9 +72,8 @@
</div>
</main>
<!-- Uncomment the line below when ready to test with fake data -->
<script src="scripts/app.js" async></script>
<script src="scripts/syncAllTabs.js" async></script>
<script src="scripts/app.js"></script>
<script src="scripts/syncAllTabs.js"></script>
<script src="scripts/deferredPrompt.js"></script>
</body>
</html>
......@@ -72,9 +72,8 @@
</div>
</main>
<!-- Uncomment the line below when ready to test with fake data -->
<script src="scripts/app.js" async></script>
<script src="scripts/syncAllTabs.js" async></script>
<script src="scripts/app.js"></script>
<script src="scripts/syncAllTabs.js"></script>
<script src="scripts/deferredPrompt.js"></script>
</body>
</html>
......@@ -227,28 +227,27 @@ function addItem (value) {
}
// adds new item to the todo list
function addItemToDOM(text, isCompleted = false ) {
var item = document.createElement('li');
item.innerText = text;
if (isCompleted) {
item.classList.add('strike');
}
var buttons = document.createElement('div');
buttons.classList.add('buttons');
var remove = document.createElement('button');
remove.classList.add('remove');
// add click event for removing items
remove.addEventListener('click', removeItem)
buttons.appendChild(remove);
item.appendChild(buttons);
list.appendChild(item);
list.insertBefore(item, list.childNodes[0]);
window.onload = function addItemToDOM(text, isCompleted = false ) {
var item = document.createElement('li');
item.innerText = text;
if (isCompleted) {
item.classList.add('strike');
}
var buttons = document.createElement('div');
buttons.classList.add('buttons');
var remove = document.createElement('button');
remove.classList.add('remove');
// add click event for removing items
remove.addEventListener('click', removeItem)
buttons.appendChild(remove);
item.appendChild(buttons);
list.appendChild(item);
list.insertBefore(item, list.childNodes[0]);
}
function createStrikedItem(item) {
......
......@@ -227,28 +227,27 @@ function addItem (value) {
}
// adds new item to the todo list
function addItemToDOM(text, isCompleted = false ) {
var item = document.createElement('li');
item.innerText = text;
if (isCompleted) {
item.classList.add('strike');
}
var buttons = document.createElement('div');
buttons.classList.add('buttons');
var remove = document.createElement('button');
remove.classList.add('remove');
// add click event for removing items
remove.addEventListener('click', removeItem)
buttons.appendChild(remove);
item.appendChild(buttons);
list.appendChild(item);
list.insertBefore(item, list.childNodes[0]);
window.onload = function addItemToDOM(text, isCompleted = false ) {
var item = document.createElement('li');
item.innerText = text;
if (isCompleted) {
item.classList.add('strike');
}
var buttons = document.createElement('div');
buttons.classList.add('buttons');
var remove = document.createElement('button');
remove.classList.add('remove');
// add click event for removing items
remove.addEventListener('click', removeItem)
buttons.appendChild(remove);
item.appendChild(buttons);
list.appendChild(item);
list.insertBefore(item, list.childNodes[0]);
}
function createStrikedItem(item) {
......