зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1402709 - Don't use capture for the toolbox context menu. r=bgrins
This commit is contained in:
Родитель
9cd0e4f0c4
Коммит
c089f03855
|
@ -453,13 +453,12 @@ Toolbox.prototype = {
|
|||
if (e.originalTarget.closest("input[type=text]") ||
|
||||
e.originalTarget.closest("input[type=search]") ||
|
||||
e.originalTarget.closest("input:not([type])") ||
|
||||
e.originalTarget.closest("textarea")
|
||||
) {
|
||||
e.originalTarget.closest("textarea")) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
this.openTextBoxContextMenu(e.screenX, e.screenY);
|
||||
}
|
||||
}, true);
|
||||
});
|
||||
|
||||
this.shortcuts = new KeyShortcuts({
|
||||
window: this.doc.defaultView
|
||||
|
|
|
@ -1124,7 +1124,15 @@ Inspector.prototype = {
|
|||
},
|
||||
|
||||
_onContextMenu: function (e) {
|
||||
if (e.originalTarget.closest("input[type=text]") ||
|
||||
e.originalTarget.closest("input:not([type])") ||
|
||||
e.originalTarget.closest("textarea")) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
this._openMenu({
|
||||
screenX: e.screenX,
|
||||
screenY: e.screenY,
|
||||
|
|
|
@ -397,6 +397,15 @@ CssRuleView.prototype = {
|
|||
* Context menu handler.
|
||||
*/
|
||||
_onContextMenu: function (event) {
|
||||
if (event.originalTarget.closest("input[type=text]") ||
|
||||
event.originalTarget.closest("input:not([type])") ||
|
||||
event.originalTarget.closest("textarea")) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
this._contextmenu.show(event);
|
||||
},
|
||||
|
||||
|
|
|
@ -356,12 +356,13 @@ Editor.prototype = {
|
|||
});
|
||||
|
||||
cm.getWrapperElement().addEventListener("contextmenu", ev => {
|
||||
ev.preventDefault();
|
||||
|
||||
if (!this.config.contextMenu) {
|
||||
return;
|
||||
}
|
||||
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
let popup = this.config.contextMenu;
|
||||
if (typeof popup == "string") {
|
||||
popup = doc.getElementById(this.config.contextMenu);
|
||||
|
|
Загрузка…
Ссылка в новой задаче