Fixed issue with blank color field
This commit is contained in:
@@ -27,6 +27,8 @@ function Picker()
|
||||
|
||||
this.validate = function()
|
||||
{
|
||||
if(!is_valid(this.el.value)){ return; }
|
||||
|
||||
dotgrid.tool.style().color = this.el.value;
|
||||
dotgrid.tool.style().fill = dotgrid.tool.style().fill != "none" ? this.el.value : "none";
|
||||
dotgrid.draw();
|
||||
@@ -63,5 +65,11 @@ function Picker()
|
||||
this.update();
|
||||
}
|
||||
|
||||
function is_valid(val)
|
||||
{
|
||||
var re = /[0-9A-Fa-f]{6}/g;
|
||||
return re.test(val)
|
||||
}
|
||||
|
||||
this.el.onkeyup = function(event){ dotgrid.picker.listen(event); };
|
||||
}
|
||||
Reference in New Issue
Block a user