1
|
|
|
jQuery(document).ready(function ($) { |
2
|
|
|
'use strict'; |
3
|
|
|
if ($('.notification-list').length) { |
4
|
|
|
$('.notification-list').slimScroll({ |
5
|
|
|
height: '100%' |
6
|
|
|
}); |
7
|
|
|
} |
8
|
|
|
if ($('.menu-list').length) { |
9
|
|
|
$('.menu-list').slimScroll({ |
10
|
|
|
height: '100%' |
11
|
|
|
}); |
12
|
|
|
} |
13
|
|
|
if ($('.navbar-nav > .nav-item > a').length) { |
14
|
|
|
$('.navbar-nav > .nav-item > a').click(function (event) { |
|
|
|
|
15
|
|
|
if ($(this).hasClass('active')) { |
16
|
|
|
$(this).removeClass('active'); |
17
|
|
|
$(this).attr('aria-expanded', 'false'); |
18
|
|
|
|
19
|
|
|
return; |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
$('.navbar-nav > .nav-item > a').each(function () { |
23
|
|
|
$(this).removeClass('active'); |
24
|
|
|
$(this).attr('aria-expanded', 'false'); |
25
|
|
|
|
26
|
|
|
const target = $(this).data('target'); |
27
|
|
|
|
28
|
|
|
$(target).removeClass('show'); |
29
|
|
|
$(target).attr('aria-expanded', 'false'); |
30
|
|
|
}) |
31
|
|
|
|
32
|
|
|
$(this).addClass('active'); |
33
|
|
|
$(this).attr('aria-expanded', 'true'); |
34
|
|
|
}); |
35
|
|
|
} |
36
|
|
|
if ($('.sidebar-nav-fixed a').length) { |
37
|
|
|
$('.sidebar-nav-fixed a').click(function (event) { |
38
|
|
|
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') |
39
|
|
|
&& location.hostname == this.hostname |
40
|
|
|
) { |
41
|
|
|
var target = $(this.hash); |
42
|
|
|
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); |
43
|
|
|
if (target.length) { |
44
|
|
|
event.preventDefault(); |
45
|
|
|
$('html, body').animate({ |
46
|
|
|
scrollTop: target.offset().top - 90 |
47
|
|
|
}, 1000, function () { |
48
|
|
|
var $target = $(target); |
49
|
|
|
$target.focus(); |
50
|
|
|
if ($target.is(':focus')) { |
51
|
|
|
return false; |
52
|
|
|
} else { |
|
|
|
|
53
|
|
|
$target.attr('tabindex', '-1'); |
54
|
|
|
$target.focus(); |
55
|
|
|
}; |
|
|
|
|
56
|
|
|
}); |
57
|
|
|
} |
58
|
|
|
}; |
59
|
|
|
|
60
|
|
|
$('.sidebar-nav-fixed a').each(function () { |
61
|
|
|
$(this).removeClass('active'); |
62
|
|
|
}) |
63
|
|
|
|
64
|
|
|
$(this).addClass('active'); |
65
|
|
|
}); |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
if ($('[data-toggle="tooltip"]').length) { |
69
|
|
|
$('[data-toggle="tooltip"]').tooltip() |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
if ($('[data-toggle="popover"]').length) { |
73
|
|
|
$('[data-toggle="popover"]').popover() |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
$(document).on('submit', 'form[data-confirmation]', function (event) { |
77
|
|
|
var $form = $(this), |
78
|
|
|
$confirm = $('#confirmationModal'); |
79
|
|
|
|
80
|
|
|
if ($confirm.data('result') !== 'yes') { |
81
|
|
|
//cancel submit event |
82
|
|
|
event.preventDefault(); |
83
|
|
|
|
84
|
|
|
$confirm |
85
|
|
|
.off('click', '#btnYes') |
86
|
|
|
.on('click', '#btnYes', function () { |
87
|
|
|
$confirm.data('result', 'yes'); |
88
|
|
|
$form.find('input[type="submit"]').attr('disabled', 'disabled'); |
89
|
|
|
$form.submit(); |
90
|
|
|
}) |
91
|
|
|
.modal('show'); |
92
|
|
|
} |
93
|
|
|
}); |
94
|
|
|
|
95
|
|
|
$(document).on('submit', 'form:not([data-confirmation])', function (event) { |
|
|
|
|
96
|
|
|
$('.overlay').show(); |
97
|
|
|
}); |
98
|
|
|
|
99
|
|
|
$(document).on('click', '.show-overlay', function (event) { |
|
|
|
|
100
|
|
|
$('.overlay').show(); |
101
|
|
|
}); |
102
|
|
|
}); |
103
|
|
|
|
104
|
|
|
function getCookie(cname) |
105
|
|
|
{ |
106
|
|
|
const name = cname + "="; |
107
|
|
|
const ca = document.cookie.split(';'); |
108
|
|
|
|
109
|
|
|
for (let i = 0; i < ca.length; i++) { |
110
|
|
|
let c = ca[i]; |
111
|
|
|
|
112
|
|
|
while (c.charAt(0) == ' ') { |
113
|
|
|
c = c.substring(1); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
if (c.indexOf(name) == 0) { |
|
|
|
|
117
|
|
|
return c.substring(name.length, c.length); |
118
|
|
|
} |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
return ''; |
122
|
|
|
} |
123
|
|
|
|
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.