Permalink
Browse files

Issue 5885 (Layout panel doesn't refresh data when resizing browser w…

  • Loading branch information...
SebastianZ committed Sep 1, 2012
1 parent e61a1b5 commit 94058bff77afa0b0701286b3abcd5c88d861910e
Showing with 10 additions and 0 deletions.
  1. +10 −0 extension/content/firebug/html/layout.js
@@ -187,6 +187,16 @@ LayoutPanel.prototype = Obj.extend(Firebug.Panel,
Firebug.Panel.destroyNode.apply(this, arguments);
},
+ show: function(state)
+ {
+ Events.addEventListener(this.context.browser, "MozAfterPaint", Obj.bindFixed(this.refresh, this), true);
+ },
+
+ hide: function()
+ {
+ Events.removeEventListener(this.context.browser, "MozAfterPaint", Obj.bindFixed(this.refresh, this), true);
+ },
+
supportsObject: function(object, type)
{
return object instanceof window.Element ? 1 : 0;

4 comments on commit 94058bf

@simonlindholm

This comment has been minimized.

Show comment
Hide comment
@simonlindholm

simonlindholm Sep 1, 2012

Member

Obj.bindFixed(this.refresh, this) returns a unique function every time you call it, so hide() won't remove the event listener that was added.

Also, a question: why prefer MozAfterPaint to onresize? Is it performant enough?

Member

simonlindholm replied Sep 1, 2012

Obj.bindFixed(this.refresh, this) returns a unique function every time you call it, so hide() won't remove the event listener that was added.

Also, a question: why prefer MozAfterPaint to onresize? Is it performant enough?

@SebastianZ

This comment has been minimized.

Show comment
Hide comment
@SebastianZ

SebastianZ Sep 2, 2012

Member

Obj.bindFixed(this.refresh, this) returns a unique function every time you call it, so hide() won't remove the event listener that was added.

Thanks for the hint. Will search for a solution for this.

Also, a question: why prefer MozAfterPaint to onresize? Is it performant enough?

I checked how the dev tools team is doing it and they also use MozAfterPaint for this purpose. In my tests it looked fast enough.

Sebastian

Member

SebastianZ replied Sep 2, 2012

Obj.bindFixed(this.refresh, this) returns a unique function every time you call it, so hide() won't remove the event listener that was added.

Thanks for the hint. Will search for a solution for this.

Also, a question: why prefer MozAfterPaint to onresize? Is it performant enough?

I checked how the dev tools team is doing it and they also use MozAfterPaint for this purpose. In my tests it looked fast enough.

Sebastian

@simonlindholm

This comment has been minimized.

Show comment
Hide comment
@simonlindholm

simonlindholm Sep 2, 2012

Member

Will search for a solution for this.

this.onAfterPaint = Obj.bindFixed(this.refresh, this); in initialize() should do.

Member

simonlindholm replied Sep 2, 2012

Will search for a solution for this.

this.onAfterPaint = Obj.bindFixed(this.refresh, this); in initialize() should do.

@SebastianZ

This comment has been minimized.

Show comment
Hide comment
@SebastianZ

SebastianZ Sep 3, 2012

Member

Will search for a solution for this.

this.onAfterPaint = Obj.bindFixed(this.refresh, this); in initialize() should do.

Of course. Like for the other listeners. Actually I already had that in mind but just didn't have the time to implement it. Did that now in bbb655d.

Sebastian

Member

SebastianZ replied Sep 3, 2012

Will search for a solution for this.

this.onAfterPaint = Obj.bindFixed(this.refresh, this); in initialize() should do.

Of course. Like for the other listeners. Actually I already had that in mind but just didn't have the time to implement it. Did that now in bbb655d.

Sebastian

Please sign in to comment.