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 ($(".sidebar-nav-fixed a").length) { |
14
|
|
|
$('.sidebar-nav-fixed a').click(function (event) { |
15
|
|
|
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') |
16
|
|
|
&& location.hostname == this.hostname |
17
|
|
|
) { |
18
|
|
|
var target = $(this.hash); |
19
|
|
|
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); |
20
|
|
|
if (target.length) { |
21
|
|
|
event.preventDefault(); |
22
|
|
|
$('html, body').animate({ |
23
|
|
|
scrollTop: target.offset().top - 90 |
24
|
|
|
}, 1000, function () { |
25
|
|
|
var $target = $(target); |
26
|
|
|
$target.focus(); |
27
|
|
|
if ($target.is(":focus")) { |
28
|
|
|
return false; |
29
|
|
|
} else { |
|
|
|
|
30
|
|
|
$target.attr('tabindex', '-1'); |
31
|
|
|
$target.focus(); |
32
|
|
|
}; |
|
|
|
|
33
|
|
|
}); |
34
|
|
|
} |
35
|
|
|
}; |
36
|
|
|
|
37
|
|
|
$('.sidebar-nav-fixed a').each(function () { |
38
|
|
|
$(this).removeClass('active'); |
39
|
|
|
}) |
40
|
|
|
|
41
|
|
|
$(this).addClass('active'); |
42
|
|
|
}); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
if ($('[data-toggle="tooltip"]').length) { |
46
|
|
|
$('[data-toggle="tooltip"]').tooltip() |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
if ($('[data-toggle="popover"]').length) { |
50
|
|
|
$('[data-toggle="popover"]').popover() |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
$(document).on('submit', 'form[data-confirmation]', function (event) { |
54
|
|
|
var $form = $(this), |
55
|
|
|
$confirm = $('#confirmationModal'); |
56
|
|
|
|
57
|
|
|
if ($confirm.data('result') !== 'yes') { |
58
|
|
|
//cancel submit event |
59
|
|
|
event.preventDefault(); |
60
|
|
|
|
61
|
|
|
$confirm |
62
|
|
|
.off('click', '#btnYes') |
63
|
|
|
.on('click', '#btnYes', function () { |
64
|
|
|
$confirm.data('result', 'yes'); |
65
|
|
|
$form.find('input[type="submit"]').attr('disabled', 'disabled'); |
66
|
|
|
$form.submit(); |
67
|
|
|
}) |
68
|
|
|
.modal('show'); |
69
|
|
|
} |
70
|
|
|
}); |
71
|
|
|
|
72
|
|
|
$(document).on('submit', 'form:not([data-confirmation])', function (event) { |
|
|
|
|
73
|
|
|
$('.overlay').show(); |
74
|
|
|
}); |
75
|
|
|
|
76
|
|
|
$(document).on('click', '.show-overlay', function (event) { |
|
|
|
|
77
|
|
|
$('.overlay').show(); |
78
|
|
|
}); |
79
|
|
|
}); |
80
|
|
|
|