Bug 1455496 - Part 1. Hide toolbar of scratchpad panel. r?dao draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Fri, 20 Apr 2018 18:35:53 +0900
changeset 785528 92001b5c4cd16e12d053ac28b6810e92eb2c9953
parent 785383 ea3555cf12afff38370e7a697db81f181e15dbf6
child 785529 e71263c7310982457d97a130cda5e7488c71cc6f
push id107248
push userbmo:mantaroh@gmail.com
push dateFri, 20 Apr 2018 09:36:46 +0000
reviewersdao
bugs1455496
milestone61.0a1
Bug 1455496 - Part 1. Hide toolbar of scratchpad panel. r?dao The scratchpad panel(in the toolbox) should not display menu bar. This patch will hide this menu bar if target is toolbox. MozReview-Commit-ID: LEzRPVgPeNs
devtools/client/scratchpad/scratchpad.js
devtools/client/scratchpad/scratchpad.xul
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -332,24 +332,24 @@ var Scratchpad = {
   get notificationBox() {
     return document.getElementById("scratchpad-notificationbox");
   },
 
   /**
    * Hide the menu bar.
    */
   hideMenu: function SP_hideMenu() {
-    document.getElementById("sp-menubar").style.display = "none";
+    document.getElementById("sp-menu-toolbar").style.display = "none";
   },
 
   /**
    * Show the menu bar.
    */
   showMenu: function SP_showMenu() {
-    document.getElementById("sp-menubar").style.display = "";
+    document.getElementById("sp-menu-toolbar").style.display = "";
   },
 
   /**
    * Get the editor content, in the given range. If no range is given you get
    * the entire editor content.
    *
    * @param number [aStart=0]
    *        Optional, start from the given offset.
--- a/devtools/client/scratchpad/scratchpad.xul
+++ b/devtools/client/scratchpad/scratchpad.xul
@@ -136,17 +136,17 @@
        command="sp-cmd-documentationLink"/>
   <key id="key_gotoLine"
        key="&gotoLineCmd.key;"
        command="key_gotoLine"
        modifiers="accel"/>
 
 </keyset>
 
-<toolbar type="menubar">
+<toolbar type="menubar" id="sp-menu-toolbar">
 <menubar id="sp-menubar">
   <menu id="sp-file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
     <menupopup id="sp-menu-filepopup">
       <menuitem id="sp-menu-newscratchpad"
                 label="&newWindowCmd.label;"
                 accesskey="&newWindowCmd.accesskey;"
                 key="sp-key-window"
                 command="sp-cmd-newWindow"/>