EasyScrollDots icon indicating copy to clipboard operation
EasyScrollDots copied to clipboard

Visibility and multiple calls

Open terryaney opened this issue 4 years ago • 0 comments

I have situation where I hide elements that have scroll-indicator class. So I needed easyScrollDots to not display those. I see that you are mostly trying to not use jquery, so I attempted too, but admittedly, js is not my primary language. You may find a better way to implement isHidden. I simply used this https://stackoverflow.com/a/21696585/166231.

Additionally, I re-organized the code to allow easyScrollDots to be called multiple times (i.e. after some visibility changes). Again, a few things to note:

  1. With jQuery events, the way I understand it, if you remove an element that had events attached, it also removes events. I wasn't sure with 'event listener'. You can correct if wrong.
  2. I'm not sure if there is a way to detect which dot to make active after rebuild or not. If you know how, I'll let you think about it.

terryaney avatar Feb 16 '21 13:02 terryaney