menufix.js 875 Bytes
$(document).ready(function () {
    if (PrimeFaces.getCookie("moyaLeftMenu") != null) {
        var menuToExpand = PrimeFaces.getCookie("moyaLeftMenu").split(",");
        for (i = 0; i < menuToExpand.length; ++i) {
            $("#" + menuToExpand[i]).css("display", "block");
        }
    }
});


/**
 * One might wonder why this is there.
 *
 * It would be really nice just link to the angular -page, but there is this "nice" prettyfaces -rewriter
 * and it does somehow catch my menulinks, and rewrite them to the .jsf -file, what is JUST what we need. PRKL!
 *
 * So let's make it the hard and dirty way.
 */
var angularMenuNavigation = function (url) {

    if (window.angularRoute) {
        var ngUrl = url.substring(8);
        window.angularRoute(ngUrl);

        pageNameSetter(url);
    } else {
        window.location.href = window.CONTEXTPATH + url;
    }

};