@@ -20,6 +20,38 @@ function toggleTerritories() {
20
20
}
21
21
}
22
22
23
+ function toggleColors ( ) {
24
+ if ( $ ( '#switcher' ) . text ( ) === 'Switch to gradient' ) {
25
+ $ ( '#color1' ) . val ( '15534C' ) ;
26
+ $ ( '#color2' ) . val ( '297159' ) ;
27
+ $ ( '#color3' ) . val ( '498F60' ) ;
28
+ $ ( '#color4' ) . val ( '73AC61' ) ;
29
+ $ ( '#color5' ) . val ( 'A6C760' ) ;
30
+ $ ( '#color6' ) . val ( 'E2E062' ) ;
31
+ $ ( '#color7' ) . val ( 'FCE77C' ) ;
32
+ $ ( '#color8' ) . val ( 'D3D3D3' ) ;
33
+ $ ( '.jscolor' ) . each ( function ( ) {
34
+ $ ( this ) . focus ( ) ;
35
+ $ ( this ) . blur ( ) ;
36
+ } ) ;
37
+ $ ( '#switcher' ) . text ( 'Switch to assortment' ) ;
38
+ } else {
39
+ $ ( '#color1' ) . val ( '8DD3C7' ) ;
40
+ $ ( '#color2' ) . val ( 'B3DE69' ) ;
41
+ $ ( '#color3' ) . val ( 'BEBADA' ) ;
42
+ $ ( '#color4' ) . val ( 'FB8072' ) ;
43
+ $ ( '#color5' ) . val ( '80B1D3' ) ;
44
+ $ ( '#color6' ) . val ( 'FCCDE5' ) ;
45
+ $ ( '#color7' ) . val ( 'FDB462' ) ;
46
+ $ ( '#color8' ) . val ( 'D3D3D3' ) ;
47
+ $ ( '.jscolor' ) . each ( function ( ) {
48
+ $ ( this ) . focus ( ) ;
49
+ $ ( this ) . blur ( ) ;
50
+ } ) ;
51
+ $ ( '#switcher' ) . text ( 'Switch to gradient' ) ;
52
+ }
53
+ }
54
+
23
55
function paintTerritory ( territory ) {
24
56
if ( $ ( 'input#territories' ) . prop ( 'checked' ) ) {
25
57
$ ( '#' + territory ) . attr ( "fill" , "#" + color ) ;
0 commit comments