Compatibilité du domlib avec les JS du ajxtags
Bonjour,
j'utilisait du domlib pour réaliser des tooltip et tout marchait trés bien :) mais dés que j'ai integré le Ajaxtags dans mon jsp j'obtient des erreurs genre.
eventPosition.set is not a function
avec eventPosition est un Hash declaré dans le domlib.js comme suit:
function domLib_getEventPosition(in_eventObj)
{
var eventPosition = new Hash('x', 0, 'y', 0, 'scrollX', 0, 'scrollY', 0);
// IE varies depending on standard compliance mode
if (domLib_isIE)
{
var doc = (domLib_standardsMode ? document.documentElement : document.body);
// NOTE: events may fire before the body has been loaded
if (doc)
{
eventPosition.set('x', in_eventObj.clientX + doc.scrollLeft);
eventPosition.set('y', in_eventObj.clientY + doc.scrollTop);
eventPosition.set('scrollX', doc.scrollLeft);
eventPosition.set('scrollY', doc.scrollTop);
}
}
else
{
eventPosition.set('x', in_eventObj.pageX);
eventPosition.set('y', in_eventObj.pageY);
eventPosition.set('scrollX', in_eventObj.pageX - in_eventObj.clientX);
eventPosition.set('scrollY', in_eventObj.pageY - in_eventObj.clientY);
}
return eventPosition;
}
conflit de Hash class dans le domLib.js avec celle de prototype.js
Apparement le problème revient sur le fait qu'il ya un conflit de la class Hach dans les deux librairies domLib.js et prototype.js utilisé par Scriptaculous library.
j'ai trouvé une solution qui consiste à renommer la class Hash dans le DokuWiki ou la remplacer pour utiliser la librairie prototype.js