Subversion Repositories SmartDukaan

Rev

Rev 27710 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
36566 amit 1
function initializeJS() {
2
 
3
    jQuery('.tooltips').tooltip();
4
 
5
    jQuery('#sidebar .sub-menu > a').click(function () {
6
        var last = jQuery('.sub-menu.open', jQuery('#sidebar'));
7
        jQuery('.menu-arrow').removeClass('arrow_carrot-right');
8
        jQuery('.sub', last).slideUp(200);
9
        var sub = jQuery(this).next();
10
        if (sub.is(":visible")) {
11
            jQuery('.menu-arrow').addClass('arrow_carrot-right');
12
            sub.slideUp(200);
13
        } else {
14
            jQuery('.menu-arrow').addClass('arrow_carrot-down');
15
            sub.slideDown(200);
16
        }
17
    });
18
 
19
    jQuery('.toggle-nav').click(function () {
20
        jQuery('#container').toggleClass('sidebar-closed');
21
    });
22
 
23
    var resizeTimer;
24
    function responsiveView() {
25
        var wSize = jQuery(window).width();
26
        if (wSize <= 768) {
27
            jQuery('#container').addClass('sidebar-closed');
28
        } else {
29
            jQuery('#container').removeClass('sidebar-closed');
30
        }
31
    }
32
    jQuery(window).on('load', responsiveView);
33
    jQuery(window).on('resize', function () {
34
        clearTimeout(resizeTimer);
35
        resizeTimer = setTimeout(responsiveView, 150);
36
    });
37
}
38
 
39
jQuery(document).ready(function () {
40
    initializeJS();
41
});