Let color be cleared (null wouldn't be returned)

This commit is contained in:
Nathan Gray 2014-11-05 23:24:02 +00:00
parent 753ce75b15
commit 2232895b39

View File

@ -193,7 +193,18 @@ var et2_color = et2_inputWidget.extend(
else if (typeof color == "object" && color.val)
{
// Prefix # to match previous picker values
this.value = '#'+color.val("hex");
var hex = color.val('hex');
// Hex might be null
if(hex)
{
hex = '#'+hex;
}
else if(this.value != hex)
{
// Color was cleared
hex = '';
}
this.value = hex;
}
// Update picker