/*
 * The Youkok2 admin module
 */

var Youkok2Admin = (function () {
    
    /*
     * Apply the generic event listeners
     */
    
    var applyEventListeners = function () {
        // Collaps/Expand
        $('[data-widget="collapse"]').on('click', function (e) {
            e.preventDefault();
            
            $(this).closest('.box').find('.box-body, .box-footer').each(function () {
                if ($(this).is(':visible')) {
                    $(this).stop().slideUp();
                }
                else {
                    $(this).stop().slideDown();
                }
            });
        });
    };
    
    /*
     * Public methods
     */
    
    return {
        
        /*
         * Init the module
         */
        
        init: function () {
            applyEventListeners();
        }
    };
})();

/*
 * jQuery goes here
 */

$(document).ready(function () {
    Youkok2Admin.init();
});
@@ -209,16 +209,24 @@
 s/Expand
+ modules
 %0D%0A      
@@ -650,24 +650,2108 @@
        %7D);%0D%0A
+        %0D%0A        // Collaps/Expand sidebar items%0D%0A        $('.treeview a').on('click', function (e) %7B%0D%0A            var $obj = $(this);%0D%0A            %0D%0A            // Make sure to only fire on sidebar expand/collaps elements%0D%0A            if ($obj.attr('href') == '#') %7B%0D%0A                e.preventDefault();%0D%0A                %0D%0A                // Some stuff%0D%0A                var $parent = $obj.parent();%0D%0A                var $grand_parent = $parent.parent();%0D%0A                var $submenu = $parent.find('ul').eq(0);%0D%0A                %0D%0A                // Make sure we have a submenu%0D%0A                if ($submenu) %7B%0D%0A                    // Check if we should expand or collaps%0D%0A                    if ($submenu.is(':visible')) %7B%0D%0A                        // Collaps child submenu%0D%0A                        $submenu.stop().slideUp(400, function () %7B%0D%0A                            // Remove active class%0D%0A                            $parent.removeClass('active');%0D%0A                            %0D%0A                            // Collaps all inner submenus too%0D%0A                            $(this).find('ul').hide();%0D%0A                            $(this).find('li.active').removeClass('active');%0D%0A                        %7D);%0D%0A                    %7D%0D%0A                    else %7B%0D%0A                        // Collaps already expanded submenus%0D%0A                        $grand_parent.find('.treeview.active %3E ul:visible').stop().slideUp(400, function () %7B%0D%0A                            // Remove active class%0D%0A                            $(this).parent().removeClass('active');%0D%0A                            %0D%0A                            // Collaps all inner submenus too%0D%0A                            $(this).parent().find('ul').hide();%0D%0A                            $(this).parent().find('li.active').removeClass('active');%0D%0A                        %7D);%0D%0A                        %0D%0A                        $submenu.stop().slideDown(400, function () %7B%0D%0A                            $parent.addClass('active');%0D%0A                        %7D);%0D%0A                    %7D%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D);%0D%0A
     %7D;%0D%0A    

Reimplement submenu functionality