views:

49

answers:

1

I'm now using the new version of the Jetpack API of which allows you to create addons for Firefox using a JS framework.

The 'panel' object is easy to use - but I'm struggling to find a way to position it. The documentation simply states (Jetpack Panel API)

panel.show(anchor) DomElement

But I'd like to position the panel in the bottom right corner of the window - How do I do this - and where can I find some more documentation about it.

Cheers guys.

Edit:

No one? Does no one know or is is a badly phrased question?

+1  A: 

The only way I'm aware of to be able to position a panel to bottom right requires an icon (or text, as in the example below) to be placed in the statusbar. After that the panel can be linked to be positioned above the icon.

Mimicking Jetpack's JEP wiki:

function openBottomRightPanel(anchor){
  jetpack.panels.open({
    url: "http://stackoverflow.com",
    anchor: anchor,
    align: "bottom right with anchor top right"
  });
}

jetpack.statusBar.append({
  html: "View SO",
  onReady: function(widget) {
    $(widget).click(function(){
      openBottomRightPanel(widget);
    });
  },
});

When the statusbar text is clicked, the resulting window (Jetpack panel) shoud open in the bottom right corner of the browser window. (N.b. Maybe the icon/text can be blank, if the panel is opened programmatically?)

Jawa
Dude thats brilliant. It makes sense. I'll give it a try. well done on your 100 points.
Glycerine
Thanks! Although, you have to accept the answer to actually reward the reputation...
Jawa
@Jawa - Woops...
Glycerine