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

Request for help, how to specify a value through javascript. #29

Closed
natecox opened this issue Nov 19, 2013 · 9 comments
Closed

Request for help, how to specify a value through javascript. #29

natecox opened this issue Nov 19, 2013 · 9 comments

Comments

@natecox
Copy link

natecox commented Nov 19, 2013

I'm trying to implement this project into my code, and so far it's working great.

My only real issue at this time is how I can specify a value for the input via javascript and have the color-picker update in turn.

Basically, I have the value that it should represent stored in a database, and the input is set to the value in the database using a javascript call. This works fine, but I can't get the preview to update to the new specified color when the update is made.

@lauren
Copy link
Owner

lauren commented Nov 21, 2013

Hey @natecox there is actually no way to do that currently, but I will add one asap. Thanks for bringing this up!

@danarmstrong
Copy link

I would like to be able to do this as well. I'm using AngularJS and created a directive for your component but it doesn't work properly with ngModel. The input field value is set properly but the color swatch is not. It only affects the creation of the component so it isn't a huge problem, but from a UX stand-point, it is a bit problematic for the default color to always be black.

@sargue
Copy link

sargue commented Dec 18, 2013

+1, didn't see it. This is a duplicate of #35 of course.

@Geczy
Copy link

Geczy commented Apr 11, 2014

Needed this as well but can't wait for an answer, so I wrote my own.

$(this).next('div.input-group-btn').find('.color-preview.current-color').css('background-color', '#' + color);

@weisjohn
Copy link

I also did @Geczy's method, but I need a way to update the color on the advanced tab.

@speendo
Copy link

speendo commented Jul 17, 2014

+1 - I would also need this feature!

@Jaza
Copy link

Jaza commented Sep 10, 2014

@weisjohn - for updating the color on the advanced tab (automatically, whenever the ".current-color" box is updated), see #61 where I've submitted a fix for this.

(although the fix is not complete, only updates the advanced preview box, not the HSL sliders - that will be harder).

@weisjohn
Copy link

@Jaza thanks for the fix, but I won't have time to check it :)

@natecox
Copy link
Author

natecox commented Sep 23, 2016

Seems as though there is a chain of open pull requests that reference this issue, and due to the extreme age of the issue I'm going to close it out.

@natecox natecox closed this as completed Sep 23, 2016
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

No branches or pull requests

8 participants