Behavior of _onClickHandler function differs

Hi
The function on _onClickHandler defind in dhtmlxTabbar.js (version 2.0) behaves differently in Firefox 3.6 and Firefox 12.

On analyzing the function we observed the following :

dhtmlXTabBar.prototype._onClickHandler=function(e){
if (_isIE){
var target = event.srcElement;
}else{
var target = e.target;
if (document.body.onclick){ //document.body.onclick is undefined in Firefox 3.6
// whereas document.body.onclick is defined in Firefox 12
document.body.onclick(e);
}

	if (_isIE){
		document.body.fireEvent("onclick",event);
	}else {
		var cl=document.createEvent("MouseEvents");
		cl.initEvent("click", true, true)
		document.body.dispatchEvent(cl);
	}
}




In firefox 3.6 (document.body.onclick) is undefined thus only the else part of condition (_isIE) gets called.

But in firefox 12 (document.body.onClick) is defined and thus both the body of :

Condition : if (document.body.onclick) and
Else part of condition : if (_isIE)

are executed. This causes the events to be called twice.

Is this behavior handled in dhtmlx version 3.0?
Is there any work around for this behavior ?

Thanks and Regards
Lakshaya Agnani

Hi,

please try to use the latest (3.0) version in your app. If the problem persists, please attached the complete demo that reproduces the problem.