Skip to content
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

Check if element '#icon' already is created #18

Open
Sandstedt opened this issue Jun 16, 2019 · 1 comment
Open

Check if element '#icon' already is created #18

Sandstedt opened this issue Jun 16, 2019 · 1 comment
Labels
optimization optimization request

Comments

@Sandstedt
Copy link
Member

Sandstedt commented Jun 16, 2019

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 Sandstedt added good first issue help need help, any contribution are welcome labels Jun 16, 2019
@xavierfoucrier
Copy link
Member

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

@xavierfoucrier xavierfoucrier added optimization optimization request and removed good first issue help need help, any contribution are welcome labels Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization optimization request
Projects
None yet
Development

No branches or pull requests

2 participants