yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
=========================================
|                                       |
|           Scroll To Top               |
|                                       |
=========================================
*/ 
$('.scrollTop').click(function() {
    $("html, body").animate({scrollTop: 0});
});
 
 
$('.navbar .dropdown.notification-dropdown > .dropdown-menu, .navbar .dropdown.message-dropdown > .dropdown-menu ').click(function(e) {
    e.stopPropagation();
});
 
/*
=========================================
|                                       |
|       Multi-Check checkbox            |
|                                       |
=========================================
*/
 
function checkall(clickchk, relChkbox) {
 
    var checker = $('#' + clickchk);
    var multichk = $('.' + relChkbox);
 
 
    checker.click(function () {
        multichk.prop('checked', $(this).prop('checked'));
    });    
}
 
 
/*
=========================================
|                                       |
|           MultiCheck                  |
|                                       |
=========================================
*/
 
/*
    This MultiCheck Function is recommanded for datatable
*/
 
function multiCheck(tb_var) {
    tb_var.on("change", ".chk-parent", function() {
        var e=$(this).closest("table").find("td:first-child .child-chk"), a=$(this).is(":checked");
        $(e).each(function() {
            a?($(this).prop("checked", !0), $(this).closest("tr").addClass("active")): ($(this).prop("checked", !1), $(this).closest("tr").removeClass("active"))
        })
    }),
    tb_var.on("change", "tbody tr .new-control", function() {
        $(this).parents("tr").toggleClass("active")
    })
}
 
/*
=========================================
|                                       |
|           MultiCheck                  |
|                                       |
=========================================
*/
 
function checkall(clickchk, relChkbox) {
 
    var checker = $('#' + clickchk);
    var multichk = $('.' + relChkbox);
 
 
    checker.click(function () {
        multichk.prop('checked', $(this).prop('checked'));
    });    
}
 
/*
=========================================
|                                       |
|               Tooltips                |
|                                       |
=========================================
*/
 
$('.bs-tooltip').tooltip();
 
/*
=========================================
|                                       |
|               Popovers                |
|                                       |
=========================================
*/
 
$('.bs-popover').popover();
 
 
/*
================================================
|                                              |
|               Rounded Tooltip                |
|                                              |
================================================
*/
 
$('.t-dot').tooltip({
    template: '<div class="tooltip status rounded-tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
})
 
 
/*
================================================
|            IE VERSION Dector                 |
================================================
*/
 
function GetIEVersion() {
  var sAgent = window.navigator.userAgent;
  var Idx = sAgent.indexOf("MSIE");
 
  // If IE, return version number.
  if (Idx > 0) 
    return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
 
  // If IE 11 then look for Updated user agent string.
  else if (!!navigator.userAgent.match(/Trident\/7\./)) 
    return 11;
 
  else
    return 0; //It is not IE
}