Event is not working for main panel

52 views
Skip to first unread message

jdka...@gmail.com

unread,
Aug 2, 2013, 3:19:30 AM8/2/13
to fir...@googlegroups.com
Hi,
I don't know if I am missing important, but I am getting strange problem with dom events:

 initializeNode: function(panelNode) {
     // Add events
     Events.addEventListener(panelNode, "click", this.onPanelFocus, true);

     Firebug.Panel.initializeNode.apply(this, arguments);
 }
,
 onPanelFocus: function(event) {
     // another code
 }


With this code:
`onPanelFocus` is executing on panel click in side panel. But for main panel, it is not.

Thanks,
Jaynti


Sebastian Zartner

unread,
Aug 2, 2013, 7:10:49 AM8/2/13
to fir...@googlegroups.com
Please use this.panelNode instead of the panelNode argument as it's done e.g. inside the HTML panel code. Does that fix your problem?

Sebastian

jdka...@gmail.com

unread,
Aug 8, 2013, 3:08:37 AM8/8/13
to fir...@googlegroups.com
Hi,
Sorry for late reply. Was stuck in some other tasks.
Today I again took a look at the problem but it seems `initializeNode` and `show` methods have different instance of `this.panelNode`.
Here is the code:

initializeNode: function(){
     Firebug.Panel.initializeNode.apply(this, arguments);
     // Take backup for oldPanelNode  
     this.oldPanelNode = this.panelNode;
     // Add event on `this.panelNode`
     Events.addEventListener(this.panelNode, "click", this.onPanelClick, false);
},
show: function(){
     // It results `false` => should be `true`
     FBTrace.sysout("Check for panelNode : " + (this.oldPanelNode === this.panelNode));
},
onPanelClick: function(){

     // code
}

I couldn't figure it out.
Thanks in advanced.

Thanks,
Jaynti

Jan Honza Odvarko

unread,
Aug 8, 2013, 4:20:34 AM8/8/13
to fir...@googlegroups.com
This sounds weird.

Is your extension available online?
Could I check it on my machine?

Honza

jdka...@gmail.com

unread,
Aug 8, 2013, 6:48:53 AM8/8/13
to fir...@googlegroups.com

It is going to be open-sourced in next week or so. I will update you as soon as it gets available on GitHub.
Interesting thing is - It just happens for main panel, not for side panels.

Thanks,
Jaynti
Reply all
Reply to author
Forward
0 new messages