undo.css | Modern CSS3 reset | Style Language library
kandi X-RAY | undo.css Summary
kandi X-RAY | undo.css Summary
Modern CSS3 reset
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of undo.css
undo.css Key Features
undo.css Examples and Code Snippets
Community Discussions
Trending Discussions on undo.css
QUESTION
I want to show/hide
the #undo
button if the array
is empty (where all of the original items have been restored from var removedItems = [];
).
I am trying to simulate an undo UX where the user has the option to restore deleted items to the list.
...ANSWER
Answered 2019-Dec-31 at 19:41I've added a check for if (!removedItems.length)
to the $('#undo')
on click eventListener, and this seems to have solved your problem - arrayCount
where it was wasn't being updated at the right time, but simply using .length
works fine.
I've also cleaned up some of the other code so it's a little easier to read, such as moving your variable assignments higher and together, and hiding box
at the start along with undo
There's a comment at the bottom showing also how to remove the box, if that's something you wanted to do.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install undo.css
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page