I have a firebug extension that helps our users debug our javascript
objects. In my panel, I have objects with Firebug.Rep subclasses for
them that represent these javascript objects. The objects are one-to-
one with DOM elements.

Now looking at the code for firebug 1.3 and now 1.4, I see a
limitation that is stopping me from using firebug's APIs.

So, I would like to use the ability to have firebug highlight the DOM
element using the inspector. I see this code in bindings.xml:
        <handler event="mouseover"><![CDATA[

            var object = Firebug.getRepObject(event.target);

            if (object)

            {

                var rep = Firebug.getRep(object);

                object = rep.getRealObject(object, FirebugContext);

                if (object)

                    Firebug.Inspector.highlightObject(object,
FirebugContext);

            }

        ]]></handler>


Then if I look at the code for the highlightObject, I see that it only
supports Element. If the object is not an element, it clears the
highlight.

Now I could return the DOM element from my rep's getRealObject(), but
that messes with the selection APIs as now the HTML element would be
selected instead of the JavaScript element.

I would love it if there was some way to have the highlighting work by
me providing the element in a way other than giving the element back.
Perhaps the bindings code that calls the inspector code could call a
new method that defaults to getRealObject to get the item to
highlight?

Something like this?

        <handler event="mouseover"><![CDATA[

            var object = Firebug.getRepObject(event.target);

            if (object)

            {

                var rep = Firebug.getRep(object);

                object = rep.getElement(object, FirebugContext);

                if (object)

                    Firebug.Inspector.highlightObject(object,
FirebugContext);

            }

        ]]></handler>


where:
Firebug.Rep = {
  ...
  getElement: function(object, context)
  {
    return this.getRealObject(object, context);
  }

What do you think?

As it stands now, I have to avoid using the _repObject functionality
and call the inspector highlightObject manually so that I can get the
functionality I desire.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to