Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 94058bff77afa0b0701286b3abcd5c88d861910e 1 parent e61a1b5
@SebastianZ SebastianZ authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 extension/content/firebug/html/layout.js
View
10 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

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
Owner

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

Will search for a solution for this.

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

@SebastianZ
Owner

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.
Something went wrong with that request. Please try again.