Closed Bug 499804 Opened 16 years ago Closed 16 years ago

Statusbar widgets cannot change their width

Categories

(Mozilla Labs :: Jetpack Prototype, defect)

x86
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aza, Assigned: myk)

Details

In Jetpack, statusbar icons cannot change their own width. Atul reports that attempting to change their width, after the initial setting, did not seem to work and that he believes that it is a platform issue causing the problem.
The ideal solution would be for Jetpack to automatically detect and apply changes to the width of the documents in statusbarpanels. Until we figure out how to make that happen, a reasonable workaround is to allow those panels to change their own widths, as described in this bug. Fixed by changeset http://hg.mozilla.org/labs/jetpack/rev/ab4ae84d66bb, which implements an event listener that automatically updates the width of a panel when it sets its document's style.width property. Both the feature and the document it loads into the statusbarpanel can modify the property. The feature does so by setting documentElement.style.width on the object passed into the onReady handler. The document does so by setting document.documentElement.style.width. For example, here's a feature that starts out at 45px wide (per the width property of the statusbar options object, whose value is an integer number of pixels) but resizes itself to 10em wide once loaded: jetpack.statusBar.append({ html: "Boom<i>!</i>", width: 45, onReady: function(widget) { widget.documentElement.style.width = "10em"; } }); Here's the same code, but with the document itself doing the resizing: jetpack.statusBar.append({ html: "<html><body onload='document.documentElement.style.width = \"10em\"'>Boom<i>!</i></body></html>", width: 45 });
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.