navigation MDL-22398 Fixed module declaration for custom menu that was reincluding javascript-static

This commit is contained in:
Sam Hemelryk 2010-05-10 09:41:32 +00:00
parent 007e52c6e5
commit d7bd9acd9c
2 changed files with 9 additions and 13 deletions

View File

@ -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);
});
}
}

View File

@ -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'));