- Joined
- Mar 7, 2018
- Messages
- 85
Clicking the eye only works once, because the event and the class are not updated.
I also noticed that the event is bound via `$(".chapter_mark_unread_button").click(func)`, change that to `$("body").on("click", ".chapter_mark_unread_button", func)` to avoid setting so many listeners.
A second benefit is that the event is dynamically called, meaning you just have to update the class (which you should already be doing but aren't) to call the other event handler.
I also noticed that the event is bound via `$(".chapter_mark_unread_button").click(func)`, change that to `$("body").on("click", ".chapter_mark_unread_button", func)` to avoid setting so many listeners.
A second benefit is that the event is dynamically called, meaning you just have to update the class (which you should already be doing but aren't) to call the other event handler.