зеркало из https://github.com/mozilla/gecko-dev.git
Bug 929888 - Remove the editor context menu listeners from the debugger, r=anton
This commit is contained in:
Родитель
a40e79c207
Коммит
b2084655d3
|
@ -15,7 +15,6 @@ function SourcesView() {
|
|||
this._onEditorLoad = this._onEditorLoad.bind(this);
|
||||
this._onEditorUnload = this._onEditorUnload.bind(this);
|
||||
this._onEditorCursorActivity = this._onEditorCursorActivity.bind(this);
|
||||
this._onEditorContextMenu = this._onEditorContextMenu.bind(this);
|
||||
this._onSourceSelect = this._onSourceSelect.bind(this);
|
||||
this._onSourceClick = this._onSourceClick.bind(this);
|
||||
this._onBreakpointRemoved = this._onBreakpointRemoved.bind(this);
|
||||
|
@ -649,7 +648,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
*/
|
||||
_onEditorLoad: function(aName, aEditor) {
|
||||
aEditor.on("cursorActivity", this._onEditorCursorActivity);
|
||||
aEditor.on("contextMenu", this._onEditorContextMenu);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -657,7 +655,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
*/
|
||||
_onEditorUnload: function(aName, aEditor) {
|
||||
aEditor.off("cursorActivity", this._onEditorCursorActivity);
|
||||
aEditor.off("contextMenu", this._onEditorContextMenu);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -678,13 +675,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The context menu listener for the source editor.
|
||||
*/
|
||||
_onEditorContextMenu: function({ x, y }) {
|
||||
this._editorContextMenuLineNumber = DebuggerView.editor.getPositionFromCoords(x, y).line;
|
||||
},
|
||||
|
||||
/**
|
||||
* The select listener for the sources container.
|
||||
*/
|
||||
|
@ -874,15 +864,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
* Called when the add breakpoint key sequence was pressed.
|
||||
*/
|
||||
_onCmdAddBreakpoint: function() {
|
||||
// If this command was executed via the context menu, add the breakpoint
|
||||
// on the currently hovered line in the source editor.
|
||||
if (this._editorContextMenuLineNumber >= 0) {
|
||||
DebuggerView.editor.setCursor({ line: this._editorContextMenuLineNumber, ch: 0 });
|
||||
}
|
||||
|
||||
// Avoid placing breakpoints incorrectly when using key shortcuts.
|
||||
this._editorContextMenuLineNumber = -1;
|
||||
|
||||
let url = DebuggerView.Sources.selectedValue;
|
||||
let line = DebuggerView.editor.getCursor().line + 1;
|
||||
let location = { url: url, line: line };
|
||||
|
@ -902,15 +883,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
* Called when the add conditional breakpoint key sequence was pressed.
|
||||
*/
|
||||
_onCmdAddConditionalBreakpoint: function() {
|
||||
// If this command was executed via the context menu, add the breakpoint
|
||||
// on the currently hovered line in the source editor.
|
||||
if (this._editorContextMenuLineNumber >= 0) {
|
||||
DebuggerView.editor.setCursor({ line: this._editorContextMenuLineNumber, ch: 0 });
|
||||
}
|
||||
|
||||
// Avoid placing breakpoints incorrectly when using key shortcuts.
|
||||
this._editorContextMenuLineNumber = -1;
|
||||
|
||||
let url = DebuggerView.Sources.selectedValue;
|
||||
let line = DebuggerView.editor.getCursor().line + 1;
|
||||
let location = { url: url, line: line };
|
||||
|
@ -1043,7 +1015,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
_cbPanel: null,
|
||||
_cbTextbox: null,
|
||||
_selectedBreakpointItem: null,
|
||||
_editorContextMenuLineNumber: -1,
|
||||
_conditionalPopupVisible: false
|
||||
});
|
||||
|
||||
|
|
|
@ -92,21 +92,21 @@ function test() {
|
|||
|
||||
function addBreakpoint2() {
|
||||
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED);
|
||||
setContextPosition(19);
|
||||
setCaretPosition(19);
|
||||
gSources._onCmdAddBreakpoint();
|
||||
return finished;
|
||||
}
|
||||
|
||||
function modBreakpoint2() {
|
||||
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.CONDITIONAL_BREAKPOINT_POPUP_SHOWING);
|
||||
setContextPosition(19);
|
||||
setCaretPosition(19);
|
||||
gSources._onCmdAddConditionalBreakpoint();
|
||||
return finished;
|
||||
}
|
||||
|
||||
function addBreakpoint3() {
|
||||
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED);
|
||||
setContextPosition(20);
|
||||
setCaretPosition(20);
|
||||
gSources._onCmdAddConditionalBreakpoint();
|
||||
return finished;
|
||||
}
|
||||
|
@ -120,14 +120,14 @@ function test() {
|
|||
|
||||
function addBreakpoint4() {
|
||||
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED);
|
||||
setContextPosition(21);
|
||||
setCaretPosition(21);
|
||||
gSources._onCmdAddBreakpoint();
|
||||
return finished;
|
||||
}
|
||||
|
||||
function delBreakpoint4() {
|
||||
let finished = waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_REMOVED);
|
||||
setContextPosition(21);
|
||||
setCaretPosition(21);
|
||||
gSources._onCmdAddBreakpoint();
|
||||
return finished;
|
||||
}
|
||||
|
@ -184,10 +184,6 @@ function test() {
|
|||
gEditor.setCursor({ line: aLine - 1, ch: 0 });
|
||||
}
|
||||
|
||||
function setContextPosition(aLine) {
|
||||
gSources._editorContextMenuLineNumber = aLine - 1;
|
||||
}
|
||||
|
||||
function clickOnBreakpoint(aIndex) {
|
||||
EventUtils.sendMouseEvent({ type: "click" },
|
||||
gDebugger.document.querySelectorAll(".dbg-breakpoint")[aIndex],
|
||||
|
|
|
@ -219,7 +219,6 @@ Editor.prototype = {
|
|||
cm = win.CodeMirror(win.document.body, this.config);
|
||||
cm.getWrapperElement().addEventListener("contextmenu", (ev) => {
|
||||
ev.preventDefault();
|
||||
this.emit("contextMenu");
|
||||
this.showContextMenu(doc, ev.screenX, ev.screenY);
|
||||
}, false);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче