mojs-player icon indicating copy to clipboard operation
mojs-player copied to clipboard

Check if element '#icon' already is created

Open Sandstedt opened this issue 6 years ago • 1 comments

Currently mojs-player creates an element in the top of body that looks like this:

<div id="icons">
  <svg ...>
    <path id="play-icon-shape" d="...">
    ...
  </svg>
</div>

This is for using svg elements as icons in the player controller.

Problem When using mulitple instances of mojs-player on the same page, we get dublicates of these elements.

Solution Should be easy to check if the element already excist in the dom before creating it again.

Sandstedt avatar Jun 16 '19 18:06 Sandstedt

Nice catch! I already noticed this behavior when I use the player last time 😉

xavierfoucrier avatar Jun 16 '19 21:06 xavierfoucrier