Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (42 loc) · 1.45 KB
/
Copy pathscript.js
File metadata and controls
50 lines (42 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// some scripts
// jquery ready start
$(document).ready(function () {
// jQuery code
/* ///////////////////////////////////////
THESE FOLLOWING SCRIPTS ONLY FOR BASIC USAGE,
For sliders, interactions and other
*/ ///////////////////////////////////////
//////////////////////// Prevent closing from click inside dropdown
$(document).on("click", ".dropdown-menu", function (e) {
e.stopPropagation();
});
$(".js-check :radio").change(function () {
var check_attr_name = $(this).attr("name");
if ($(this).is(":checked")) {
$("input[name=" + check_attr_name + "]")
.closest(".js-check")
.removeClass("active");
$(this).closest(".js-check").addClass("active");
// item.find('.radio').find('span').text('Add');
} else {
item.removeClass("active");
// item.find('.radio').find('span').text('Unselect');
}
});
$(".js-check :checkbox").change(function () {
var check_attr_name = $(this).attr("name");
if ($(this).is(":checked")) {
$(this).closest(".js-check").addClass("active");
// item.find('.radio').find('span').text('Add');
} else {
$(this).closest(".js-check").removeClass("active");
// item.find('.radio').find('span').text('Unselect');
}
});
//////////////////////// Bootstrap tooltip
if ($('[data-toggle="tooltip"]').length > 0) {
// check if element exists
$('[data-toggle="tooltip"]').tooltip();
} // end if
});
// jquery end