pupunzi/jquery.mb.menu — pull request #13 by tjdhome (2013-04-14 01:58:14+00:00)
Title: Generalized ajax dynamic menu creation.

Generalized ajax behavior into a menu factory. This makes it possible
for the user to specify a function tht will create submenus (given the
'op' and menuName).

Add 'menuFetcher' to your options list and supply a function that takes
three parameters.

Here is the default version, which is just the current ajax fetch.

menuFetcher: function(op, m, callback){
$.ajax({
type: "POST",
url: op.options.template,
cache: false,
async: false,
data:"menuId="+m+(op.options.additionalData!=""?"&"+op.options.additionalData:""),
dataType:"html",
success: callback
});
}

I found this useful when mbmenu is used with angularjs,
because often it is required to 'compile' some html into a
menu.