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

Fix wpColorPicker Error #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Akamaozu
Copy link

@Akamaozu Akamaozu commented May 3, 2016

BACKGROUND

  1. The main JS file always calls $('.at-color')wpColorPicker() even if the user never instantiated a color field.
  2. The class only enqueues wp-color-picker lib only if the user instantiates a color field.

PROBLEM
If the user doesn't have a color field, the main js file will always fail.

SOLUTION
Don't call wpColorPicker() unless a color field is detected in the dom. If a color field was created using the api, there should be a color field in the DOM and wp-color-picker would be instantiated by the class.

@Akamaozu
Copy link
Author

Akamaozu commented May 3, 2016

Should fix #117 and #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant