diff --git a/selectmenu.js b/selectmenu.js index 53e6ac0..8a7e273 100644 --- a/selectmenu.js +++ b/selectmenu.js @@ -610,7 +610,7 @@ a.on('click.selectMenu',function(e){ e.stopPropagation(); if(row.disabled) return; - row.callback(); + row.callback(e); self.hideResults(self); }); } @@ -1594,4 +1594,4 @@ $.fn.selectMenu = old; return this; }; -})(window.jQuery); \ No newline at end of file +})(window.jQuery); diff --git a/selectmenu.min.js b/selectmenu.min.js index a26dfdc..f8f6896 100644 --- a/selectmenu.min.js +++ b/selectmenu.min.js @@ -1 +1 @@ -(function(f){var i;i=function(k){function j(){}j.generate=function(){var l=j._getRandomInt,m=j._hexAligner;return m(l(32),8)+"-"+m(l(16),4)+"-"+m(16384|l(12),4)+"-"+m(32768|l(14),4)+"-"+m(l(48),12)};j._getRandomInt=function(l){if(0>l||53>>30-l};j._hexAligner=function(l,p){for(var m=l.toString(16),o=p-m.length,n="0";0>>=1,n+=n){o&1&&(m=n+m)}return m};j.overwrittenUUID=k;"undefined"!==typeof module&&module&&module.exports&&(module.exports=j);return j}(i);var e={data:undefined,search:true,title:"SelectMenu",regular:false,rightClick:false,arrow:false,position:"left",embed:false,lang:"cn",multiple:false,listSize:10,maxSelectLimit:0,selectToCloseList:false,initSelected:undefined,keyField:"id",showField:"name",searchField:undefined,andOr:"AND",orderBy:undefined,pageSize:100,formatItem:undefined,eSelect:undefined,eTabSwitch:undefined,eHidden:undefined};var a=function(j,k){this.target=j;this.setOption(k);if(this.option.embed&&!f(j).is("div")){console.warn('SelectMenu embed mode need a "div" container element!');return}this.setLanguage();this.setCssClass();this.setProp();if(k.regular){this.setRegularMenu()}else{this.setElem()}if(!k.rightClick){this.populate()}this.eInput();if(!k.embed){this.eWhole()}this.atLast()};a.version="2.1";a.dataKey="selectMenuObject";a.dataTypeList="SelectMenuList";a.dataTypeGroup="SelectMenuGroup";a.dataTypeMenu="SelectMenuMenu";a.prototype.setOption=function(j){j.searchField=j.searchField||j.showField;if(j.regular&&j.title===e.title){j.title=false}if(j.embed||j.rightClick){j.arrow=false}j.andOr=j.andOr.toUpperCase();if(j.andOr!=="AND"&&j.andOr!=="OR"){j.andOr="AND"}j.orderBy=(j.orderBy===undefined)?j.showField:j.orderBy;j.orderBy=this.setOrderbyOption(j.orderBy,j.showField);if(f.type(j.data)==="string"){j.autoSelectFirst=false}if(f.type(j.listSize)!=="number"||j.listSize<0){j.listSize=12}this.option=j};a.prototype.setOrderbyOption=function(k,n){var j=[],m=[];if(typeof k=="object"){for(var l=0;l");l.container.addClass(k.container).addClass(k.direction_bottom);if(m.title){l.header=f("
").addClass(k.header);l.header.append("

"+m.title+"

");if(m.multiple){l.selectAllButton=f('').attr("title",this.message.select_all_btn).addClass(k.btn_selectall);l.removeAllButton=f('').attr("title",this.message.remove_all_btn).addClass(k.btn_removeall);l.header.append(l.selectAllButton);l.header.append(l.removeAllButton)}if(!m.embed){l.closeButton=f('').attr("title",j.message.close_btn).addClass(k.btn_close);l.header.append(l.closeButton)}}l.inputArea=f("
").addClass(k.input_area);l.input=f('').addClass(k.input);l.resultArea=f("
").addClass(k.re_area);l.resultTabs=f("
").addClass(k.re_tabs);l.results=f("