empty value support

pull/25/head
peterd 9 years ago
parent bf464a2919
commit 9f11548aa2

@ -198,7 +198,8 @@
s = colors.hsv.s * _$xy_slider._width, s = colors.hsv.s * _$xy_slider._width,
v = (1 - colors.hsv.v) * _$xy_slider._height, v = (1 - colors.hsv.v) * _$xy_slider._height,
a = alpha * _$alpha._width, a = alpha * _$alpha._width,
translate3d = _GPU ? 'translate3d' : ''; translate3d = _GPU ? 'translate3d' : '',
hasNoValue = _$trigger.val() === '' && typeof toggled === 'boolean';
_$xy_slider._css = { _$xy_slider._css = {
backgroundColor: 'rgb(' + backgroundColor: 'rgb(' +
@ -221,10 +222,11 @@
borderColor : alphaContrast + ' transparent' borderColor : alphaContrast + ' transparent'
}; };
_$trigger._css = { _$trigger._css = {
backgroundColor : text, backgroundColor : hasNoValue ? '' : text,
color: colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light color: hasNoValue ? '' :
colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light
}; };
_$trigger.text = _$trigger.val() !== text ? text : ''; _$trigger.text = hasNoValue ? '' : _$trigger.val() !== text ? text : '';
toggled !== undefined ? render(toggled) : _animate(render); toggled !== undefined ? render(toggled) : _animate(render);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save