File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change 123
123
init ( ) ;
124
124
}
125
125
126
- // Set the init method to re-run if the page is saved or pjaxed
127
- if ( $ . entwine ) {
128
- $ . entwine ( 'ss' , function ( $ ) {
129
- $ ( '.googlemapfield' ) . entwine ( {
130
- onmatch : function ( ) {
131
- if ( gmapsAPILoaded ) {
132
- init ( ) ;
133
- }
126
+ // CMS stuff: set the init method to re-run if the page is saved or pjaxed
127
+ // there are no docs for the CMS implementation of entwine, so this is hacky
128
+ if ( ! ! $ . fn . entwine && $ ( document . body ) . hasClass ( 'cms' ) ) {
129
+ ( function setupCMS ( ) {
130
+ var matchFunction = function ( ) {
131
+ if ( gmapsAPILoaded ) {
132
+ init ( ) ;
134
133
}
134
+ } ;
135
+ $ . entwine ( 'ss' , function ( $ ) {
136
+ $ ( '.cms-tabset' ) . entwine ( {
137
+ onmatch : matchFunction
138
+ } ) ;
139
+ $ ( '.cms-tabset-nav-primary li' ) . entwine ( {
140
+ onclick : matchFunction
141
+ } ) ;
142
+ $ ( '.ss-tabset li' ) . entwine ( {
143
+ onclick : matchFunction
144
+ } ) ;
135
145
} ) ;
136
- } ) ;
146
+ } ( ) ) ;
137
147
}
138
148
139
149
} ( jQuery ) ) ;
You can’t perform that action at this time.
0 commit comments