Skip to content

Commit bc0bb2e

Browse files
remove duplicate tags fields
1 parent eba1eaa commit bc0bb2e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

dojo/templates/base.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,17 +1213,16 @@ <h4 class="modal-title" id="sessionModalLabel">Session Expiring Soon</h4>
12131213
}, 100);
12141214
});
12151215

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);
12271226

12281227
});
12291228
</script>

0 commit comments

Comments
 (0)