Sha256: 01577ab6f3159087bbc968ce3b002c494a7f6dc4fca3b34817c9e346982c8eb4

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

$(function(){  
    
    function setupTheme() {

        var $menu = $("#sidebar-nav");

        // sidebar menu dropdown toggle
        $("#dashboard-menu .dropdown-toggle").click(function (e) {
            e.preventDefault();
            var $item = $(this).parent();
            $item.toggleClass("active");
            if ($item.hasClass("active")) {
                $item.find(".submenu").slideDown("fast");
            } else {
                $item.find(".submenu").slideUp("fast");
            }
        });


        // mobile side-menu slide toggler
        $("body").click(function () {
            if ($(this).hasClass("menu")) {
                $(this).removeClass("menu");
            }
        });

        $menu.click(function (e) {
            e.stopPropagation();
        });

        $("#menu-toggler").click(function (e) {
            e.stopPropagation();
            $("body").toggleClass("menu");
        });

        $(window).resize(function () {
            $(this).width() > 769 && $("body.menu").removeClass("menu")
        });


        // build all tooltips from data-attributes
        $("[data-toggle='tooltip']").each(function (index, el) {
            $(el).tooltip({
                placement: $(this).data("placement") || 'top'
            });
        });


        // quirk to fix dark skin sidebar menu because of B3 border-box
        if ($menu.height() > $(".content").height()) {
            $("html").addClass("small");
        }
    }

    $(document).on('ready page:load', setupTheme);
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rademade_admin-0.0.3 app/assets/javascripts/rademade_admin/detail_admin/theme.js
rademade_admin-0.0.2 app/assets/javascripts/rademade_admin/detail_admin/theme.js
rademade_admin-0.0.1 app/assets/javascripts/rademade_admin/detail_admin/theme.js