Bug 1251823 - fix adding breakpoints through context menu in debugger r=me
authorJames Long <longster@gmail.com>
Thu, 03 Mar 2016 12:19:09 -0500
changeset 324832 7b5e74921ea3102ad308b74774d9faa836efe6d2
parent 324831 50f6df5b5581fa77fd521767d6e5ab0b255bb899
child 324833 217b441ef860497f6770a27fa2ba988060ae00ed
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1251823
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1251823 - fix adding breakpoints through context menu in debugger r=me
devtools/client/debugger/content/views/sources-view.js
devtools/client/debugger/debugger-view.js
--- a/devtools/client/debugger/content/views/sources-view.js
+++ b/devtools/client/debugger/content/views/sources-view.js
@@ -1142,17 +1142,17 @@ SourcesView.prototype = Heritage.extend(
     }
   },
 
   /**
    * Called when the add breakpoint key sequence was pressed.
    */
   _onCmdAddBreakpoint: function(e) {
     let actor = this.selectedValue;
-    let line = (e && e.sourceEvent.target.tagName == 'menuitem' ?
+    let line = (this.DebuggerView.clickedLine ?
                 this.DebuggerView.clickedLine + 1 :
                 this.DebuggerView.editor.getCursor().line + 1);
     let location = { actor, line };
     let bp = getBreakpoint(this.getState(), location);
 
     // If a breakpoint already existed, remove it now.
     if (bp) {
       this.actions.removeBreakpoint(bp.location);
--- a/devtools/client/debugger/debugger-view.js
+++ b/devtools/client/debugger/debugger-view.js
@@ -332,16 +332,20 @@ var DebuggerView = {
           if (this.editor.hasBreakpoint(line)) {
             this.controller.dispatch(actions.removeBreakpoint(location));
           } else {
             this.controller.dispatch(actions.addBreakpoint(location));
           }
         }
       }
     });
+
+    this.editor.on("cursorActivity", () => {
+      this.clickedLine = null;
+    });
   },
 
   updateEditorBreakpoints: function(source) {
     const breakpoints = queries.getBreakpoints(this.controller.getState());
     const sources = queries.getSources(this.controller.getState());
 
     for (let bp of breakpoints) {
       if (sources[bp.location.actor] && !bp.disabled) {