| 21627 |
kshitij.so |
1 |
function initializeJS() {
|
|
|
2 |
|
|
|
3 |
//tool tips
|
|
|
4 |
jQuery('.tooltips').tooltip();
|
|
|
5 |
|
|
|
6 |
jQuery("#sidebar").niceScroll({styler:"fb",cursorcolor:"#007AFF", cursorwidth: '3', cursorborderradius: '10px', background: '#F7F7F7', cursorborder: ''});
|
|
|
7 |
|
|
|
8 |
//sidebar dropdown menu
|
|
|
9 |
jQuery('#sidebar .sub-menu > a').click(function () {
|
|
|
10 |
var last = jQuery('.sub-menu.open', jQuery('#sidebar'));
|
|
|
11 |
jQuery('.menu-arrow').removeClass('arrow_carrot-right');
|
|
|
12 |
jQuery('.sub', last).slideUp(200);
|
|
|
13 |
var sub = jQuery(this).next();
|
|
|
14 |
if (sub.is(":visible")) {
|
|
|
15 |
jQuery('.menu-arrow').addClass('arrow_carrot-right');
|
|
|
16 |
sub.slideUp(200);
|
|
|
17 |
} else {
|
|
|
18 |
jQuery('.menu-arrow').addClass('arrow_carrot-down');
|
|
|
19 |
sub.slideDown(200);
|
|
|
20 |
}
|
|
|
21 |
var o = (jQuery(this).offset());
|
|
|
22 |
diff = 200 - o.top;
|
|
|
23 |
if(diff>0)
|
|
|
24 |
jQuery("#sidebar").scrollTo("-="+Math.abs(diff),500);
|
|
|
25 |
else
|
|
|
26 |
jQuery("#sidebar").scrollTo("+="+Math.abs(diff),500);
|
|
|
27 |
});
|
|
|
28 |
|
|
|
29 |
// sidebar menu toggle
|
|
|
30 |
jQuery(function() {
|
|
|
31 |
function responsiveView() {
|
|
|
32 |
var wSize = jQuery(window).width();
|
|
|
33 |
if (wSize <= 768) {
|
|
|
34 |
jQuery('#container').addClass('sidebar-close');
|
|
|
35 |
jQuery('#sidebar > ul').hide();
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
if (wSize > 768) {
|
|
|
39 |
jQuery('#container').removeClass('sidebar-close');
|
|
|
40 |
jQuery('#sidebar > ul').show();
|
|
|
41 |
}
|
|
|
42 |
}
|
|
|
43 |
jQuery(window).on('load', responsiveView);
|
|
|
44 |
jQuery(window).on('resize', responsiveView);
|
|
|
45 |
});
|
|
|
46 |
|
|
|
47 |
jQuery('.toggle-nav').click(function () {
|
|
|
48 |
if (jQuery('#sidebar > ul').is(":visible") === true) {
|
|
|
49 |
jQuery('#main-content').css({
|
|
|
50 |
'margin-left': '0px'
|
|
|
51 |
});
|
|
|
52 |
jQuery('#sidebar').css({
|
|
|
53 |
'margin-left': '-180px'
|
|
|
54 |
});
|
|
|
55 |
jQuery('#sidebar > ul').hide();
|
|
|
56 |
jQuery("#container").addClass("sidebar-closed");
|
|
|
57 |
} else {
|
|
|
58 |
jQuery('#main-content').css({
|
|
|
59 |
'margin-left': '180px'
|
|
|
60 |
});
|
|
|
61 |
jQuery('#sidebar > ul').show();
|
|
|
62 |
jQuery('#sidebar').css({
|
|
|
63 |
'margin-left': '0'
|
|
|
64 |
});
|
|
|
65 |
jQuery("#container").removeClass("sidebar-closed");
|
|
|
66 |
}
|
|
|
67 |
});
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
jQuery(document).ready(function(){
|
|
|
71 |
initializeJS();
|
|
|
72 |
});
|