diff --git a/lib/javascript-static.js b/lib/javascript-static.js index a2a03438447..b08d4df56f8 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -1531,11 +1531,13 @@ M.core_custom_menu = { * @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); + Y.use('node-menunav', function(Y) { + // 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); + }); } } \ No newline at end of file diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index f0dec41bd56..f3ca2f82465 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2214,14 +2214,8 @@ END; // Increment the menu count. This is used for ID's that get worked with // in JavaScript as is essential $menucount++; - // Setup the module for this so we get what we need. - $module = array( - 'name' => 'custom_menu', - 'fullpath' => '/lib/javascript-static.js', - 'requires' => array('node-menunav') - ); // Initialise this custom menu - $this->page->requires->js_init_call('M.core_custom_menu.init', array('custom_menu_'.$menucount), false, $module); + $this->page->requires->js_init_call('M.core_custom_menu.init', array('custom_menu_'.$menucount)); // Build the root nodes as required by YUI $content = html_writer::start_tag('div', array('id'=>'custom_menu_'.$menucount, 'class'=>'yui3-menu yui3-menu-horizontal javascript-disabled')); $content .= html_writer::start_tag('div', array('class'=>'yui3-menu-content'));