File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1213,17 +1213,16 @@ <h4 class="modal-title" id="sessionModalLabel">Session Expiring Soon</h4>
1213
1213
} , 100 ) ;
1214
1214
} ) ;
1215
1215
1216
- <!-- TODO not working with django tagulous which uses select2, break styling -->
1217
- <!-- $('#id_tags').select2({ -->
1218
- <!-- 'placeholder': 'Select or add some tags...', -->
1219
- <!-- 'no_results_text': "Tag not found, press TAB key to add.", -->
1220
- <!-- }); -->
1221
-
1222
- $ ( 'select' ) . not ( '#notification-scope' ) . addClass ( 'selectpicker' ) ;
1223
- $ ( '.selectpicker' ) . attr ( 'data-live-search' , 'true' ) ;
1224
- $ ( '.selectpicker' ) . attr ( 'data-container' , 'body' ) ;
1225
- $ ( '.selectpicker' ) . css ( 'width' , '70%' ) ;
1226
- $ ( '.selectpicker' ) . selectpicker ( 'render' ) ;
1216
+ // Simple cleanup after page load
1217
+ setTimeout ( function ( ) {
1218
+ $ ( 'input[data-tagulous]' ) . each ( function ( ) {
1219
+ var $input = $ ( this ) ;
1220
+ var $containers = $input . siblings ( '.select2-container' ) ;
1221
+ if ( $containers . length > 1 ) {
1222
+ $containers . not ( ':first' ) . remove ( ) ;
1223
+ }
1224
+ } ) ;
1225
+ } , 100 ) ;
1227
1226
1228
1227
} ) ;
1229
1228
</ script >
You can’t perform that action at this time.
0 commit comments