Converts user entry in the form of '#1B2' into '#11BB22' for user

design swatches
This commit is contained in:
Sarven Capadisli 2009-06-16 02:33:10 +00:00
parent 2f693c4c94
commit bd8f9a979a
1 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,9 @@ $(document).ready(function() {
swatches
.each(SynchColors)
.blur(function() {
$(this).val($(this).val().toUpperCase());
tv = $(this).val();
$(this).val(tv.toUpperCase());
(tv.length == 4) ? ((tv[0] == '#') ? $(this).val('#'+tv[1]+tv[1]+tv[2]+tv[2]+tv[3]+tv[3]) : '') : '';
})
.focus(function() {
$('#color-picker').show();