]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Converts user entry in the form of '#1B2' into '#11BB22' for user
authorSarven Capadisli <csarven@controlyourself.ca>
Tue, 16 Jun 2009 02:33:10 +0000 (02:33 +0000)
committerSarven Capadisli <csarven@controlyourself.ca>
Tue, 16 Jun 2009 02:33:10 +0000 (02:33 +0000)
design swatches

js/farbtastic/farbtastic.go.js

index 4e0493b40a857c8aa1c85d36c48fba362608c7b6..2f202ced1f95e530cf463e979e9ba4f266784bdc 100644 (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();