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

Model updates while I'm dragging the color-picker #72

Open
BadgerBadgerBadgerBadger opened this issue Dec 4, 2014 · 3 comments
Open

Comments

@BadgerBadgerBadgerBadger

So basically, when using the color-picker, I do not want my model updating when I drag on the color-picker. I only want my model updated when I'm done dragging and let go.

Any ideas on how to do this?

@buberdds
Copy link
Owner

Hi, probably an outdated answer, but all you have to do is to find "mousemove" function and remove

if(ngModel) {
  $scope.$apply(ngModel.$setViewValue(newColor));
}

then at the beginning of "mouseup" function add this:

if(ngModel) {
  $scope.$apply(ngModel.$setViewValue(pickerColor[thisFormat]()));
}

It's a nice performance boost. I wonder if people need to update the model on every mousedown event.

@enthusiasmus
Copy link

$scope.$on("colorpicker-selected") works perfect for me. But the only problem is, that entering a color in the colorpicker-input field doesn't trigger that event... any chance this will be implemented?

best regards
p.s.: thx for the great and simple colorpicker!

@aschroederSportsdigita
Copy link

I have been using '$scope.$on("colorpicker-selected")' and it works well for only getting called when a color is selected.

Small issue (unless it's wanted functionality) encountered, though...

So when I drag around the cross-hairs the color returned in that callback works perfectly. The problem I have been having is when I simply click somewhere in the color-picker - the color returned in the callback does not get updated to my new click location. I'd be happy to elaborate on that if I'm making no sense.

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

4 participants