navigation MDL-22398 Added custom menu to Moodle core. Will document in theme's forum

This commit is contained in:
Sam Hemelryk
2010-05-10 05:24:00 +00:00
parent 4886029cba
commit d2dbd0c0d0
10 changed files with 484 additions and 8 deletions

View File

@@ -1518,3 +1518,24 @@ M.util.help_icon = {
this.Y = Y;
}
}
/**
* Custom menu namespace
*/
M.core_custom_menu = {
/**
* This method is used to initialise a custom menu given the id that belongs
* to the custom menu's root node.
*
* @param {YUI} Y
* @param {string} nodeid
*/
init : function(Y, nodeid) {
// Get the node
var node = Y.one('#'+nodeid);
// Remove the javascript-disabled class.... obviously javascript is enabled.
node.removeClass('javascript-disabled');
// Initialise the menunav plugin
node.plug(Y.Plugin.NodeMenuNav);
}
}