Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/components/color-picker/color-picker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Expose `ColorPicker`.
*/
Expand Down Expand Up @@ -103,6 +102,7 @@ ColorPicker.prototype.height = function(n){
ColorPicker.prototype.spectrumEvents = function(){
var self = this
, canvas = $(this.spectrum)
, application = $("html")
, down;

function update(e) {
Expand All @@ -118,11 +118,11 @@ ColorPicker.prototype.spectrumEvents = function(){
update(e);
});

canvas.mousemove(function(e){
application.mousemove(function(e){
if (down) update(e);
});

canvas.mouseup(function(){
application.mouseup(function(){
down = false;
});
};
Expand All @@ -136,6 +136,7 @@ ColorPicker.prototype.spectrumEvents = function(){
ColorPicker.prototype.mainEvents = function(){
var self = this
, canvas = $(this.main)
, application = $("html")
, down;

function update(e) {
Expand All @@ -151,11 +152,11 @@ ColorPicker.prototype.mainEvents = function(){
update(e);
});

canvas.mousemove(function(e){
application.mousemove(function(e){
if (down) update(e);
});

canvas.mouseup(function(){
application.mouseup(function(){
down = false;
});
};
Expand Down