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

Commit

Permalink
Merge pull request #109 from krk/master
Browse files Browse the repository at this point in the history
Fix: Support entering named colors into the input control.
  • Loading branch information
mjolnic committed Apr 1, 2015
2 parents f03780a + 894da8a commit 6576b4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions dist/js/bootstrap-colorpicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
if (val.toLowerCase !== undefined) {
// cast to string
val = val + '';
if (val.charAt(0) !== "#" && (val.length === 3 || val.length === 6)) {
val = '#' + val;
}
this.setColor(val);
} else if (val.h !== undefined) {
this.value = val;
Expand Down Expand Up @@ -531,8 +528,8 @@
format: 'alias',
parse: function(execResult) {
var hexval = this.colorNameToHex(execResult[0]) || '#000000';
var match = this.stringParsers[0].re.exec(hexval),
values = match && this.stringParsers[0].parse.apply(this, [match]);
var match = this.stringParsers[6].re.exec(hexval),
values = match && this.stringParsers[6].parse.apply(this, [match]);
return values;
}
}],
Expand Down
Loading

0 comments on commit 6576b4c

Please sign in to comment.