-
-
Notifications
You must be signed in to change notification settings - Fork 195
Expand file tree
/
Copy pathscript.js
More file actions
20 lines (17 loc) · 584 Bytes
/
script.js
File metadata and controls
20 lines (17 loc) · 584 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$(function () {
$('select:not(.custom-select)').each(function () {
$(this).select2({
theme: 'bootstrap4',
width: $(this).data('width') ? $(this).data('width') : $(this).hasClass('w-100') ? '100%' : 'style',
closeOnSelect: !$(this).attr('multiple')
})
})
})
$(document).on('click', '.toggle-validation-js', function (e) {
e.preventDefault()
$this = $(this)
$this.closest('.form-group').toggleClass('was-validated')
$selectElement = $this.closest('.form-group').find('select')
$selectElement
.toggleClass($this.data('validationClass'))
})