(function(){function e(a){a._tidclose||(a._tidclose=setTimeout(function(){a._bover||a._autodrop&&a.isOpen()&&a.close({sendOnOpen:!0});a._tidclose=null},200))}function f(a,b,c){jq(a.$n()).toggleClass(a.$s("open"),c);b&&b.sendOnOpen&&a.fire("onOpen",{open:c,value:a.getLabel()},{rtags:{onOpen:1}})}function g(a,b){if(!a._oldppclose){var c=a.firstChild;if(c){var d=jq(c),e=jq(a).width();d.width()<e&&(d.width(e-zk(c).padBorderWidth()),c.fire(c.firstChild),(d=c._openInfo)&&c.position.apply(c,d))}a._oldppclose=
c.close;b&&a.domListen_(c,"onMouseOver").domListen_(c,"onMouseOut");c.close=function(d){a._oldppclose.apply(c,arguments);f(a,d,!1);b&&a.domUnlisten_(c,"onMouseOver").domUnlisten_(c,"onMouseOut");c.close=a._oldppclose;delete a._oldppclose}}}zul.wgt.Combobutton=zk.$extends(zul.wgt.Button,{$define:{autodrop:null},getZclass:function(){return"z-combobutton"},domContent_:function(){var a='<span id="'+this.uuid+'-txt" class="'+this.$s("text")+'">'+zUtl.encodeXML(this.getLabel())+"</span>",b=this.getImage(),
c=this.domIcon_();if(!b&&!c)return a;b=b?'<img class="'+this.$s("image")+'" src="'+b+'" />'+(c?" "+c:""):c;c="vertical"==this.getOrient()?"<br/>":" ";return"reverse"==this.getDir()?a+c+b:b+c+a},domClass_:function(a){var b=this.$supers(zul.wgt.Combobutton,"domClass_",arguments);this._isDefault()||(b+=" z-combobutton-toolbar");return b},_isDefault:function(){return"default"==this._mold},isOpen:function(){var a=this.firstChild;return a&&a.isOpen()},setOpen:function(a,b){if(!this._disabled&&!zk.animating())this[a?
"open":"close"](b||{})},renderInner_:function(a){for(var b=this.firstChild;b;b=b.nextSibling)b.redraw(a)},isTableLayout_:function(){return!0},unbind_:function(){var a;(a=this.firstChild)&&(a=a.$n())&&this.domUnlisten_(a,"onMouseOver").domUnlisten_(a,"onMouseOut");this.$supers("unbind_",arguments)},doFocus_:function(a){this==a.target&&this.$supers("doFocus_",arguments)},open:function(a){var b=this.firstChild;b&&!this.isOpen()&&(b.$instanceof(zul.wgt.Popup)&&(b.open(this.uuid,null,"after_start",a),
f(this,a,!0)),g(this,!b.$instanceof(zul.wgt.Menupopup)))},close:function(a){this.isOpen()&&this.firstChild.close(a)},doClick_:function(a){var b=a.domTarget;if(b){var c=!this.isOpen();this==a.target&&(this.$n("btn")!=b&&this.$n("icon")!=b&&c?this.$supers("doClick_",arguments):this.setOpen(c,{sendOnOpen:!0}))}},doMouseDown_:function(a){this==a.target&&this.$supers("doMouseDown_",arguments)},doMouseOver_:function(a){this._bover=!0;if(this==a.target){var b=a.domTarget;!this._autodrop||this.$n("btn")!=
b&&this.$n("icon")!=b||this.isOpen()||this.open({sendOnOpen:!0});this.$supers("doMouseOver_",arguments)}},doMouseOut_:function(a){this._bover=!1;e(this);this.$supers("doMouseOut_",arguments)},_doMouseOver:function(a){this._bover=!0},_doMouseOut:function(a){this._bover=!1;e(this)},doKeyDown_:function(a){this._doKeyDown(a);a.stopped||this.$supers("doKeyDown_",arguments)},_doKeyDown:function(a){a=a.keyCode;var b=this.isOpen();40!=a||b?13==a||32==a?this.fire("onClick"):27==a&&b&&this.close():this.open({sendOnOpen:!0})},
focus_:function(a){if(this.isDisabled())return!1;if(!zk.focusBackFix||!this._upload){var b=this,c=this.$n();zk.afterAnimate(function(){try{c.focus(),zk.currentFocus=b,zjq.fixInput(c)}catch(d){zk.debugLog(d.message||d)}},a)}return!0},ignoreDescendantFloatUp_:function(a){return a&&a.$instanceof(zul.wgt.Popup)},rerender:function(a){this.isOpen()&&this.close();this.$supers("rerender",arguments)}})})();
