MenuManager.menuCommand Member

Syntax

object.menuCommand(event);

Arguments

ArgumentSummary
event

Returns

Remarks

See Also

Source Code

function mmgr_menucmd(event)
{
/* evals the attribute named |attr| on the node |node|. */
function evalAttribute(node, attr)
{
var ex;
var expr = node.getAttribute(attr);
if (!expr)
return null;
try
{
return eval(expr);
}
catch (ex)
{
dd ("caught exception evaling '" + node.getAttribute("id") + "'.'" +
attr + "': '" + expr + "'\n" + ex);
}
return null;
};
var menuitem = event.originalTarget;
var cx = this.cx;
/* We need to re-run the repeat-map if the user has selected a special
* repeat-generated menu item, so that the context object is correct.
*/
if (menuitem.hasAttribute("repeatgenerated") &&
menuitem.hasAttribute("repeatmap"))
{
cx.index = menuitem.getAttribute("repeatindex");
var ary = cx.repeatList[menuitem.getAttribute("repeatid")];
var item = ary[cx.index];
/* Apply any updates to "cx" for this item by evaluating
* "repeatmap" with "cx" and "item" in scope. This may just
* copy some attributes from "item" to "cx" or it may do more.
*/
evalAttribute(menuitem, "repeatmap");
}
eval(this.commandStr);
}