Web Inspector: Don't show 'Reveal In Debugger Tab' menu item if already in Debugger tab
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 22:46:46 +0000 (22:46 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 22:46:46 +0000 (22:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147554

Reviewed by Timothy Hatcher.

Check current tab before appending context menu items.

* UserInterface/Base/Main.js:
(WebInspector.isShowingDebuggerTab):
* UserInterface/Views/SourceCodeTextEditor.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187900 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js

index 7ba2d1e..6e936ad 100644 (file)
@@ -1,3 +1,16 @@
+2015-08-04  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Don't show 'Reveal In Debugger Tab' menu item if already in Debugger tab
+        https://bugs.webkit.org/show_bug.cgi?id=147554
+
+        Reviewed by Timothy Hatcher.
+
+        Check current tab before appending context menu items.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.isShowingDebuggerTab):
+        * UserInterface/Views/SourceCodeTextEditor.js:
+
 2015-08-04  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: buttons in new tab screen lack hover styles
index 14c24c7..b8c736b 100644 (file)
@@ -794,6 +794,11 @@ WebInspector.showDebuggerTab = function(breakpointToSelect, showScopeChainDetail
     this.tabBrowser.showTabForContentView(tabContentView);
 };
 
+WebInspector.isShowingDebuggerTab = function()
+{
+    return this.tabBrowser.selectedTabContentView instanceof WebInspector.DebuggerTabContentView;
+};
+
 WebInspector.showResourcesTab = function()
 {
     var tabContentView = this.tabBrowser.bestTabContentViewForClass(WebInspector.ResourcesTabContentView);
index e27427e..4e8e256 100644 (file)
@@ -1022,7 +1022,7 @@ WebInspector.SourceCodeTextEditor = class SourceCodeTextEditor extends WebInspec
         }
 
         // Single breakpoint.
-        if (breakpoints.length === 1) {
+        if (breakpoints.length === 1 && !WebInspector.isShowingDebuggerTab()) {
             var breakpoint = breakpoints[0];
 
             breakpoint.appendContextMenuItems(contextMenu, event.target);