@@ -70,6 +70,13 @@ method exported by the
7070
7171 panel.show();
7272
73+ ## Panel Positioning ##
74+
75+ By default the panel appears in the center of the currently active browser window.
76+ You can position the panel by passing a ` position ` to the panel's
77+ [ constructor] ( modules/sdk/panel.html#Panel(options) ) or to
78+ its [ ` show() ` ] ( modules/sdk/panel.html#show(options) ) method.
79+
7380## Updating Panel Content ##
7481
7582You can update the panel's content simply by setting the panel's ` contentURL `
@@ -425,23 +432,23 @@ Creates a panel.
425432 The position of the panel.
426433 Ignored if the panel is opened by a widget.
427434
428- You can set as value an object that has one or more of the following
429- properites : `top`, `right`, `bottom` and `left`. Their values are expressed
435+ This is an object that has one or more of the following
436+ properties : `top`, `right`, `bottom` and `left`. Their values are expressed
430437 in pixels. Any other properties will be ignored.
431438
432- The default alignment is centered, so for example panel can be displayed in
433- the center of the bottom corner by leaving off vertical axis:
439+ The default alignment along each axis is centered: so to display a panel centred
440+ along the vertical or horizontal axis, just omit that axis:
434441
435- // Show the panel to the centered horizontally and aligned to the bottom
436- // of the content area
442+ // Show the panel centered horizontally and
443+ // aligned to the bottom of the content area
437444 require("sdk/panel").Panel({
438445 position: {
439446 bottom: 0
440447 }
441448 }).show();
442449
443- // Show the panel to the centered vertically and aligned to the left o
444- // the content area
450+ // Show the panel centered vertically and
451+ // aligned to the left of the content area
445452 require("sdk/panel").Panel({
446453 position: {
447454 left: 0
@@ -451,23 +458,27 @@ Creates a panel.
451458 // Centered panel, default behavior
452459 require("sdk/panel").Panel({}).show();
453460
454- In the same way of their CSS counterpart, setting both `top` and `bottom`,
455- or `left` and `right`, will results in calculated the `height` and `width`:
461+ As with the CSS `top`, `bottom`, `left`, and `right` properties, setting
462+ both `top` and `bottom` or both `left` and `right` will implicitly set the
463+ panel's `height` or `width` relative to the content window:
456464
457- // Show the panel centered horizontally, that is distant 40px
458- // from the top and 100px from the bottom.
465+ // Show the panel centered horizontally, with:
466+ // - the top edge 40px from the top of the content window
467+ // - the bottom edge 100px from the bottom of the content window
459468 require("sdk/panel").Panel({
460469 position: {
461470 top: 40,
462471 bottom: 100
463472 }
464473 }).show();
465474
466- Set implicitly `height` in this example, will makes the panel ignore the
467- `bottom` property, as the CSS homonym properties does:
475+ If you set both `top` and `bottom`, but also set the panel's height
476+ explicitly using the `height` property, then the panel will ignore
477+ `bottom`, just as CSS does for its properties with the same name:
468478
469- // Show the panel centered horizontally, that is distant 40px from the top
470- // and has 400px as height
479+ // Show the panel centered horizontally, with:
480+ // - the top edge 40px from the top of the content window
481+ // - a height of 400px
471482 require("sdk/panel").Panel({
472483 position: {
473484 top: 40,
@@ -485,7 +496,8 @@ Creates a panel.
485496 height: 400
486497 }).show();
487498
488- The same principle is applied for `width`, `left` and `right`.
499+ The same principle is applied in the horizontal axis with
500+ `width`, `left` and `right`.
489501
490502 @prop [ focus=true] {boolean}
491503 Set to ` false ` to prevent taking the focus away when the panel is shown.
@@ -644,8 +656,10 @@ Displays the panel.
644656
645657If the ` options ` argument is given, it will be shallow merged with the options
646658provided in the constructor: the ` options ` passed in the ` show ` method takes
647- the precedence.
648- It's useful for temporary changes, without touching the default values.
659+ precedence.
660+
661+ Passing options here is useful for making temporary changes without touching
662+ the default values.
649663
650664@param options {object}
651665 Showing options for the panel, with the following keys:
0 commit comments