Question

I want open/show my panel widget by click on my context-menu item to send some data from the dom position click to my panel.

I'm open for lot of solutions !

Was it helpful?

Solution

I don't know if this works but try it out, its sdk style

var panels = require("sdk/panel");
var self = require("sdk/self");

var panel = panels.Panel({
  contentURL: self.data.url("panel.html")
});

var cm = require("sdk/context-menu");
cm.Item({
  label: "Edit Image",
  context: cm.SelectorContext("img"),
  contentScript: 'self.on("click", function () {' +
                 '  self.postMessage(null);' +
                 '});',
  onMessage: function (msg) {
  panel.show({
    //position: button //set position to some anchor
  });
  }
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top