Git Product home page Git Product logo

amai-todo-list's People

Contributors

alaataima avatar amoodaa avatar asem1789 avatar mohammadalhalaq avatar

Watchers

 avatar  avatar

Forkers

mohammadalhalaq

amai-todo-list's Issues

reset input value

document.querySelector('input[name=description]').value = "";

to avoid get element two times, in the first get just get the element and then check value and reset it as you want

let inputText = document.querySelector('input[name=description]')

createTodoNode

this one will tell the render how to show the <li> items
and add buttons to it, add event listeners to them.
and make it work with addTodoForm

To avoid empty input value

if(inputText){

if I click on submit with empty input or add space without any character it will add, so you can use this or try to solve it as you like

  if(inputText.value.trim()){

it will remove space from the start of a string and check if there a real value

a mistake in getting an element from index.html

sortFormBtn.addEventListener('click',function(event){

when you add a new element you have an error which is

dom.js:107 Uncaught TypeError: Cannot read property 'addEventListener' of null
    at HTMLFormElement.<anonymous> (dom.js:107)

because you have a mistake when you get the element, you writ this line

 var sortFormBtn = document.getElementById('add-todo input[type=button]');

but when you back to index.html there isn`t this id for sort button and getElemetBy
Id can't use as you used, so add an id for the button and use getElemetById in the right way your error will be solved.

Dom.js file

  • createTodoNode
  • addTodoForm if
  • save to local storage
  • reloading from local storage
  • trying everything out and everything will stay on the same page

create mark-btn

1- creat checkbox input.
2- add mark todo function to checkbox-input.

add todo item

todoFunctions.addTodo in logic.js
tests before code, separate branches and pair programming

File structure

JS

  • logic.js
  • dom.js

CSS

  • style.css

test

  • test.js

index.html

and npm init, install tape, and .gitignore ready

ISSUES

why your issues without description?
just write small description of what will do in issue

test is failed

t.deepEquals(todoFunctions.editTodo(state,'new first todo',-3),expected1,"id -3 edit test");

you make a test for editTodo function but this function isn't defined in the logic.js file, I think you have lost lines in the logic.js file

responsive

the sort and submit buttons are not responsive

style.css

  • make Classes inside dom.js
  • then use these classes in dom by element.classlist.add or toggle
  • use bem naming convention

deleteTodo-function

  // should leave the input argument todos unchanged (you can use cloneArrayOfObjects)
  // return a new array, this should not contain any todo with an id of idToDelete
  // hint: array.filter

delete todo item

todoFunctions.deleteTodo in logic.js
create separate branches for test and function bod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.