Bug 1534808 - Don't show pretty print option for non-JS sources r=jlast
authorDavid Walsh <davidwalsh83@gmail.com>
Thu, 14 Mar 2019 20:31:41 +0000
changeset 521981 33f142760b69
parent 521980 fa6af8c14ee4
child 521982 c0613d0cb732
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1534808
milestone67.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 1534808 - Don't show pretty print option for non-JS sources r=jlast Differential Revision: https://phabricator.services.mozilla.com/D23333
devtools/client/debugger/new/src/components/Editor/Tab.js
--- a/devtools/client/debugger/new/src/components/Editor/Tab.js
+++ b/devtools/client/debugger/new/src/components/Editor/Tab.js
@@ -18,16 +18,17 @@ import type { Source } from "../../types
 import actions from "../../actions";
 
 import {
   getDisplayPath,
   getFileURL,
   getRawSourceURL,
   getSourceQueryString,
   getTruncatedFileName,
+  isJavaScript,
   isPretty,
   shouldBlackbox
 } from "../../utils/source";
 import { copyToTheClipboard } from "../../utils/clipboard";
 import { getTabMenuItems } from "../../utils/tabs";
 
 import {
   getSelectedSource,
@@ -144,17 +145,17 @@ class Tab extends PureComponent<Props> {
           disabled: !shouldBlackbox(source),
           click: () => toggleBlackBox(source)
         }
       },
       {
         item: {
           ...tabMenuItems.prettyPrint,
           click: () => togglePrettyPrint(tab),
-          disabled: isPretty(sourceTab)
+          disabled: isPretty(source) || !isJavaScript(source)
         }
       }
     ];
 
     showMenu(e, buildMenu(items));
   }
 
   isProjectSearchEnabled() {