-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3db1625
commit bb7051a
Showing
10 changed files
with
97 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<html dir="ltr"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta content="width=device-width" name="viewport"> | ||
<title>Color Picker</title> | ||
<link href="color-picker.min.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<p>Show and hide color picker panel with double click.</p> | ||
<p><input type="text"></p> | ||
<script src="color-picker.min.js"></script> | ||
<script> | ||
|
||
var picker = new CP(document.querySelector('input')); | ||
|
||
// Disable the default blur and focus behavior | ||
picker.on('blur', function() {}); | ||
picker.on('focus', function() {}); | ||
|
||
picker.on('change', function(r, g, b, a) { | ||
this.source.value = this.color(r, g, b, a); | ||
}); | ||
|
||
picker.source.addEventListener('dblclick', function(e) { | ||
picker.enter(); | ||
e.stopPropagation(); | ||
}, false); | ||
|
||
document.documentElement.addEventListener('dblclick', function() { | ||
picker.exit(); | ||
}, false); | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.