Bug 1192281: Uplift Add-on SDK to fx-team. a=me
96ae8d914f...5ac44b7e08
This commit is contained in:
@@ -223,6 +223,20 @@ function show(panel, options, anchor) {
|
||||
}
|
||||
exports.show = show
|
||||
|
||||
function onPanelClick(event) {
|
||||
let { target, metaKey, ctrlKey, shiftKey, button } = event;
|
||||
let accel = platform === "darwin" ? metaKey : ctrlKey;
|
||||
let isLeftClick = button === 0;
|
||||
let isMiddleClick = button === 1;
|
||||
|
||||
if ((isLeftClick && (accel || shiftKey)) || isMiddleClick) {
|
||||
let link = target.closest('a');
|
||||
|
||||
if (link && link.href)
|
||||
getMostRecentBrowserWindow().openUILink(link.href, event)
|
||||
}
|
||||
}
|
||||
|
||||
function setupPanelFrame(frame) {
|
||||
frame.setAttribute("flex", 1);
|
||||
frame.setAttribute("transparent", "transparent");
|
||||
@@ -301,6 +315,8 @@ function make(document) {
|
||||
panel.addEventListener("popupshown", onPanelStateChange, false);
|
||||
panel.addEventListener("popuphidden", onPanelStateChange, false);
|
||||
|
||||
panel.addEventListener("click", onPanelClick, false);
|
||||
|
||||
// Panel content document can be either in panel `viewFrame` or in
|
||||
// a `backgroundFrame` depending on panel state. Listeners are set
|
||||
// on both to avoid setting and removing listeners on panel state changes.
|
||||
|
||||
Reference in New Issue
Block a user