Closed Bug 796222 Opened 8 years ago Closed 8 years ago
Create panels with more appropriate default width to avoid mis-aligned anchor
The panels we create seem to have a default width of around 100x100, before we then resize the panel to fit the content - but still use a fixed width of 330px. This resize behaviour causes the panel anchor to be in the wrong position when first displayed (see bug 793057). We can work around that issue by arranging for the panels to always be created with an initial width of 330px.
I think we should kill the max-width while we're at it, either that or make max-width = min(600, screen.width / 2);
Actually, we don't have a max-width at all - we have a totally fixed width. The CSS from the amigo currently don't offer any clues we can use at all - if we try and use the offsetWidth, for example, we will end up with all panels being exactly 100px wide (as that is what the CSS says). I'm hoping to chat with them today about this.
Assignee: nobody → mhammond
Attachment #667818 - Flags: review?(jaws)
Comment on attachment 667818 [details] [diff] [review] Set the width of the iframe on creation to the panel default width Review of attachment 667818 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/base/content/browser-social.js @@ +612,5 @@ > notificationFrame.setAttribute("id", notificationFrameId); > notificationFrame.setAttribute("mozbrowser", "true"); > + // work around bug 793057 - by making the panel roughly the final size > + // we are more likely to have the anchor in the correct position. > + notificationFrame.style.width = "330px"; Can we set this width in a CSS rule for .social-panel-frame ?
Comment on attachment 667818 [details] [diff] [review] Set the width of the iframe on creation to the panel default width Discussed this on IRC and the solution of setting this value in external CSS will propagate a value among various files, removing the containment of a current workaround (the 330px seen elsewhere in browser-social.js).
Attachment #667818 - Flags: review?(jaws) → review+
As discussed on IRC with Jaws, we are keeping the code where it is, but using the constant PANEL_MIN_WIDTH introduced with bug 797716. https://hg.mozilla.org/integration/mozilla-inbound/rev/5b5981c2106b
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 18
Attachment #667818 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.