Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 94058bff77afa0b0701286b3abcd5c88d861910e 1 parent e61a1b5
Sebastian Zartner authored September 01, 2012

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. 10  extension/content/firebug/html/layout.js
10  extension/content/firebug/html/layout.js
@@ -187,6 +187,16 @@ LayoutPanel.prototype = Obj.extend(Firebug.Panel,
187 187
         Firebug.Panel.destroyNode.apply(this, arguments);
188 188
     },
189 189
 
  190
+    show: function(state)
  191
+    {
  192
+        Events.addEventListener(this.context.browser, "MozAfterPaint", Obj.bindFixed(this.refresh, this), true);
  193
+    },
  194
+
  195
+    hide: function()
  196
+    {
  197
+        Events.removeEventListener(this.context.browser, "MozAfterPaint", Obj.bindFixed(this.refresh, this), true);
  198
+    },
  199
+    
190 200
     supportsObject: function(object, type)
191 201
     {
192 202
         return object instanceof window.Element ? 1 : 0;

4 notes on commit 94058bf

Simon Lindholm
Collaborator

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?

Sebastian Zartner
Collaborator

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

Simon Lindholm
Collaborator

Will search for a solution for this.

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

Sebastian Zartner
Collaborator

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.