[dev] Broken tooltip.js

Chuck Hagenbuch chuck at horde.org
Wed Nov 1 18:48:11 PST 2006


Quoting Jason Clifton <jason at citydiesel.net>:

> Not sure if this is the correct list...

This list is fine for development questions in general.

> I've been working on converting the nag panel.inc to ajax, sort of  
> like the kronolith one.  I added 1 function to panel.inc listed  
> below and a <div> labeled all just below the </head> tag on  
> common-headers.inc and a </div> at the end of /list/task_footers.inc
>
> The ajax part works fine updates correctly and all that but if you  
> update with the ajax menu tooltips no longer display correctly they  
> still include the <pre> tags and seem to have lost all formatting.   
> If you click refresh tooltips work correctly again until you use the  
> ajax menu

Right. The tooltips attach to elements of the DOM. By doing a partial  
refresh using ajax, you're modifying the DOM and introducing new  
elements that need to be modified by the tooltip behavior. So the only  
step you're missing is re-applying the behavior to the new DOM  
elements. In Kronolith, this is accomplished with this code after the  
update:

     if (typeof ToolTips == 'object') {
         ToolTips.out();
         ToolTips.attachBehavior();
     }

Something very similar to that after your handler updates the div  
should work (but you need to make sure it happens onComplete of the  
Ajax.Updater, you can't just call it on the next line because of the  
nature of asynchronous call).

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the dev mailing list