widget-uievents-min.js revision 345548fa72bc0f96aa4a436f07b6bab6c6819612
YUI.add("widget-uievents",function(G){var E=/(\w+):(\w+)/,F="$2",D="boundingBox",H="parentNode",C=G.Widget,B="render",A=G.Lang;G.mix(C.prototype,{_destroyUIEvents:function(){var I=G.stamp(this,true),J=this._uievts;if(J){G.each(J,function(L,K){if(L.instances[I]){delete L.instances[I];if(G.Object.isEmpty(L.instances)){L.handle.detach();if(J[K]){delete J[K];}}}});}},UI_EVENTS:G.Node.DOM_EVENTS,_getUIEventNode:function(){return this.get(D);},_createUIEvent:function(K){var N=this._getUIEventNode(),I=N.get(H),J=(G.stamp(I)+K),M,L;this._uievts=this._uievts||{};M=this._uievts[J];if(!M){L=I.delegate(K,function(O){var P=C.getByNode(this);P.fire(O.type,{domEvent:O});},"."+G.Widget.getClassName());this._uievts[J]=M={instances:{},handle:L};}M.instances[G.stamp(this)]=1;},_getUIEvent:function(J){if(A.isString(J)){var K=J.replace(E,F),I;if(this.UI_EVENTS[K]){I=K;}return I;}},_initUIEvent:function(J){var K=this._getUIEvent(J),I=this._uiEvtsInitQueue||{};if(K&&!I[K]){this._uiEvtsInitQueue=I[K]=1;this.after(B,function(){this._createUIEvent(K);delete this._uiEvtsInitQueue[K];});}},on:function(I){this._initUIEvent(I);return C.superclass.on.apply(this,arguments);},after:function(I){this._initUIEvent(I);return C.superclass.after.apply(this,arguments);},publish:function(J,I){var K=this._getUIEvent(J);if(K&&I&&I.defaultFn){this._initUIEvent(K);}return C.superclass.publish.apply(this,arguments);}},true);},"@VERSION@",{requires:["widget-base","node-event-delegate"]});