Skip to content

Don't re-render when calling swatchify multiple times #12

Description

@tatemz

When I have a <div class="swatch"> and I run $('.swatch').swatchify(); multiple times on the same DOM element, multiple swatches are produced. Would be great if swatchify() checked if the DOM element has already rendered color swatches to avoid cloning swatches.

Additionally, it would be ideal to have the DOM element recalculated to take changes to the data-colors attribute into account. This may hinder performance, so perhaps a swatchify( recalculate = true/false ) might be advisable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions