@@ -2,7 +2,25 @@ let grantsNumPages = '';
22let grantsHasNext = false ;
33let numGrants = '' ;
44
5- let toggleStyle ;
5+ const toggleStyle = function ( style ) {
6+ let banner ;
7+
8+ if ( style . bg ) {
9+ banner = `url("${ style . bg } ") center top / ${ style . size || '' } ${ style . color || '' } no-repeat` ;
10+ } else {
11+ banner = `url("${ style . banner_image } ") center no-repeat` ;
12+ }
13+ $ ( '#grant-hero-img' ) . css ( 'background' , banner ) ;
14+ if ( style . background_image ) {
15+ $ ( '#grant-background-image-mount-point' ) . css ( 'background-image' , style . background_image ) ;
16+ }
17+
18+ if ( style . inline_css ) {
19+ $ ( 'style' ) . last ( ) . text ( style . inline_css ) ;
20+ } else {
21+ $ ( 'style' ) . last ( ) . text ( '' ) ;
22+ }
23+ } ;
624
725$ ( document ) . ready ( ( ) => {
826 $ ( '#sort_option' ) . select2 ( {
@@ -52,28 +70,7 @@ $(document).ready(() => {
5270
5371 } ) ;
5472
55- toggleStyle = function ( style ) {
56- let banner ;
57-
58- if ( style . bg ) {
59- banner = `url("${ style . bg } ") center top / ${ style . size || '' } ${ style . color || '' } no-repeat` ;
60- } else {
61- banner = `url("${ style . banner_image } ") center no-repeat` ;
62- }
63- $ ( '#grant-hero-img' ) . css ( 'background' , banner ) ;
64- if ( style . background_image ) {
65- $ ( '#grant-background-image-mount-point' ) . css ( 'background-image' , style . background_image ) ;
66- }
67-
68- if ( style . inline_css ) {
69- $ ( 'style' ) . last ( ) . text ( style . inline_css ) ;
70- } else {
71- $ ( 'style' ) . last ( ) . text ( '' ) ;
72- }
73-
74- } ;
7573 toggleStyle ( document . current_style ) ;
76-
7774} ) ;
7875
7976Vue . component ( 'grant-sidebar' , {
0 commit comments