//Copyright © [Year(s)] Nokia Corporation and/or its subsidiary(-ies).
Fp.Utils.Events={addTapEvent:function(a){if(!a||!a.element||!a.onEvent){return false;}if(a.feedback===false){a.element.addEventListener("mouseup",this.onMouseUp(a.onEvent),false);}else{if(a.element._mouseup){a.element.removeEventListener("mouseup",a.element._mouseup,false);delete a.element._mouseup;}if(a.element._mouseout){a.element.removeEventListener("mouseout",a.element._mouseout,false);delete a.element._mouseout;}a.element._mouseup=this.add7BrowserEvent(a.onEvent);a.element.addEventListener("mouseup",a.element._mouseup,false);if(a.element._mouseout){a.element.addEventListener("mouseout",a.element._mouseout,false);}}}};Fp.Utils.Events.addTapEvent.prototype={tapEvent:null,tappedElement:null,clearTapState:function(){Fp.Utils.removeClass(this,"two-rows");Fp.Utils.removeClass(this,"active");},addTapState:function(){if(this.className.indexOf("disabled")===-1){Fp.Utils.addClass(this,"active");}},onMouseUp:function(a){return function(c){var b=Fp.Utils.Events.addTapEvent.prototype;Fp.Utils.Events.addTapEvent.prototype.clearTapState.call(this,b.tappedElement);a(c);};},add7BrowserEvent:function(a){return function(c){var b=Fp.Utils.Events.addTapEvent.prototype;b.addTapState.call(this);if(b.tappedElement){b.clearTapState.call(b.tappedElement);}clearTimeout(b.tapEvent);b.tappedElement=this;b.tapEvent=setTimeout(b.clear7BrowserEvent(a,c),300);};},clear7BrowserEvent:function(a,b){return function(){var c=Fp.Utils.Events.addTapEvent.prototype;a(b,c.tappedElement);c.clearTapState.call(c.tappedElement);c.tappedElement=null;};}};