[Project_owners] How to disable the default tooltip in tabbrowser

Net One netone at gmail.com
Mon Jan 3 11:24:19 EST 2005


Dear Simon,

I don't want to disable all the default tooltips in the tabbrowser
strip. I just want disabing the default tooltips for those elements
that have their own tooltip text. I've tried setting the "tooltip"
attribute to "" for these elements. But that doesn't work. Finally I
got the problem solved by changing the "onpopupshowing" of the tooltip
element to the following:

        event.preventBubble();

        if (document.tooltipNode.hasAttribute('label') &&
!document.tooltipNode.hasAttribute('tooltiptext'))
        {
            this.setAttribute('label',
document.tooltipNode.getAttribute('label'));
            return true;
        }

        return false;


On Sun, 02 Jan 2005 19:19:37 +0100, Simon Wunderlin <simon at wunderlin.net> wrote:
> Net One schrieb:
> > The following code in tabbrowser.xml of the Firefox global bindings:
> >
> > <xul:hbox class="tabbrowser-strip chromeclass-toolbar"
> > collapsed="true" tooltip="_child" context="_child">
> > <xul:tooltip onpopupshowing="event.preventBubble(); if
> > (document.tooltipNode.hasAttribute('label')) {
> > this.setAttribute('label',
> > document.tooltipNode.getAttribute('label')); return true; } return
> > false;"/>
> > ...
> 
> somwhere in your init code (should execute once the window is created):
> var el = document.getElementById("id of the xul box");
> el.setAttribute("tooltip", ""); // or null, not sure
> 
> i haven't tested this particular example, but i have done it the other
> way round (setting a tooltip attr) and it worked.
> 
> Cheers,
> --
> Simon
> 


-- 
Best regard,
NetOne, netone at gmail.com


More information about the Project_owners mailing list