forked from suvelocity/kanban-final
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json mixup fix #3
Open
gabbyMill
wants to merge
14
commits into
main
Choose a base branch
from
JSON-mixup-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Built html structure with little css. In this case we only have 3 buttons which is why I preferred this approach then event delegation on the whole section. Create element helper function is handy here to create a li tag. Currently this is not storing in local storage correctly. The only features are adding to the list.
Added a function to load the dom according to local storage. Each time a new <li> is appended it is updated in the local storage
Made alt function with help of object keeping track of whether a key is pressed or not using keydown and keyup. All of code uses iteration to set eventListeners instead of delegating (read that it's lighter, not sure if it's better practice or not..)
Made cards editable with makeeditable attribute. On double click it sets the attribute and the 'blur' event listener. Afterwards uses splice to replace edited value with old value in parsed version of local storage.
Made global search function using html classes and css hidden functionality. Also works retroactively when adding new cards while searching for a specific value.
Added 2 functions to save and load data from the api and update it in local storage. In load function, it checks if the data is the same as in local storage, if not it updates and refreshes the page.
Made more generic function to update local storage which is used throughout all of the code. Made bonus features including 1.Color palette that you can paint your categories\boxes 2.Bold and underline cards 3.Made enter work as well, like add button.
Oh no
This event 'e' was in the same function as an existing event 'e'. It didn't cause any problems though.
To my mistake, I thought the API needed the value of its tasks property to be stored as a string (like in local storage). Hence, I sent it over as a string and did some ugly string replacement when loading it back to the browser. Only later I understood the proper way of doing this, although the former way still worked it was certainly NOT ideal. Plus, it deleted '\' from card text if there was any.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.