!function(root,ax_super){var U=ax5.util,axd=ax5.dom,ax_class=function(){this.main=function(){ax_super&&ax_super.call(this),this.config={keys:{value:"value",text:"text",shortcut:"shortcut",data:"data",menu:"menu"}}}.apply(this,arguments);var cfg=this.config;this.init=function(){cfg.target&&cfg.menu||U.error("aui_menu_400","[ax5.ui.menu] config.target, config.menu is required"),cfg.target=ax5.dom(cfg.target),this.print_list()},this.print_list=function(){var cfg=this.config,po=[];po.push('<ul class="ax-item-group">');for(var i=0,l=cfg[cfg.keys.menu].length;l>i;i++)po.push('<a class="ax-item" data-menu-item="'+i+'">'),po.push(cfg[cfg.keys.menu][i][cfg.keys.text]),po.push("</a>");po.push("</ul>"),cfg.target.html(po.join("")),cfg.target.find("[data-menu-item]").on("click",function(e){this.onclick(e||window.event)}.bind(this))},this.onclick=function(e,target,index){target=axd.parent(e.target,function(target){return ax5.dom.attr(target,"data-menu-item")?!0:void 0}),target&&(index=axd.attr(target,"data-menu-item"),this.config.onclick&&this.config.onclick.call({menu:this.config[cfg.keys.menu],item:this.config[cfg.keys.menu][index],target:cfg.target.elements[0],item_target:target}))}};U.is_function(ax_super)&&(ax_class.prototype=new ax_super),root.menu=ax_class,"function"==typeof define&&define.amd&&define("_ax5_ui_menu",[],function(){return ax_class})}(ax5.ui,ax5.ui.root);