2
0
mirror of https://github.com/PitPik/tinyColorPicker synced 2025-07-26 19:34:29 -06:00

small optimization

This commit is contained in:
peterd 2015-03-27 13:20:52 +01:00
parent 64147c126c
commit 5d98d3fc09

View File

@ -199,8 +199,9 @@
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' : '',
triggerValue = _$trigger.val(),
hasNoValue = _$trigger[0].hasAttribute('value') && hasNoValue = _$trigger[0].hasAttribute('value') &&
_$trigger.val() === '' && toggled !== undefined; triggerValue === '' && toggled !== undefined;
_$xy_slider._css = { _$xy_slider._css = {
backgroundColor: 'rgb(' + backgroundColor: 'rgb(' +
@ -227,7 +228,7 @@
color: hasNoValue ? '' : color: hasNoValue ? '' :
colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light colors.rgbaMixBGMixCustom.luminance > 0.22 ? dark : light
}; };
_$trigger.text = hasNoValue ? '' : _$trigger.val() !== text ? text : ''; _$trigger.text = hasNoValue ? '' : triggerValue !== text ? text : '';
toggled !== undefined ? render(toggled) : _animate(render); toggled !== undefined ? render(toggled) : _animate(render);
} }
@ -317,4 +318,4 @@
}); });
}); });
}; };
})(window.jQuery, Colors); })(jQuery, Colors);