specify positioning item for popup menus

This commit is contained in:
evgenyzinoviev 2016-01-22 03:18:04 +01:00
parent 7842a657d0
commit 072ab0ddea
7 changed files with 20 additions and 10 deletions

View file

@ -158,7 +158,7 @@ Menu.prototype._init = function() {
};
};
Menu.prototype.popup = function(window, x, y) {
Menu.prototype.popup = function(window, x, y, positioningItem) {
if ((window != null ? window.constructor : void 0) !== BrowserWindow) {
// Shift.
y = x;
@ -166,7 +166,7 @@ Menu.prototype.popup = function(window, x, y) {
window = BrowserWindow.getFocusedWindow();
}
if ((x != null) && (y != null)) {
return this._popupAt(window, x, y);
return this._popupAt(window, x, y, positioningItem || 0);
} else {
return this._popup(window);
}