Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Added selectColorOption #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ $('select[name="colorpicker"]').simplecolorpicker({
- picker: show the colors inside a picker instead of inline (default: `false`)
- pickerDelay: show and hide animation delay in milliseconds (default: `0`)

#### Added selectColor option
Now is possible to use **selectColor** with other options:

```JavaScript
$('select[name="colorpicker"]')
.simplecolorpicker({ theme: 'glyphicons', selectColor: '#e1e1e1' })
.on('change', function() {
$(document.body).css('background-color', $('select[name="colorpicker"]').val());
});
```

## Browser support

Simplecolorpicker supports all modern browsers starting with Internet Explorer 8 included.
Expand Down
5 changes: 5 additions & 0 deletions jquery.simplecolorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@
if (data === undefined) {
$this.data('simplecolorpicker', (data = new SimpleColorPicker(this, options)));
}
/* Added selectColor option with other options */
if (option.selectColor) {
args.push(option.selectColor);
option = 'selectColor';
}
if (typeof option === 'string') {
data[option].apply(data, args);
}
Expand Down