[Pkg-mozext-commits] [firebug] 03/28: add scrollbar to commandHistory popup

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag firebug-1.10.3
in repository firebug.

commit b3bbc89ae366b7f1721e8388962162670b5cb968
Author: nightwing <amirjanyan at gmail.com>
Date:   Fri Aug 3 00:31:35 2012 +0400

    add scrollbar to commandHistory popup
---
 extension/content/firebug/console/commandHistory.js | 15 +++++++++------
 extension/content/firebug/firebug.css               |  3 ++-
 extension/content/firebug/firebugOverlay.xul        |  4 ++--
 extension/skin/classic/win/firebug.css              |  2 ++
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/extension/content/firebug/console/commandHistory.js b/extension/content/firebug/console/commandHistory.js
index 2419eda..093f8b0 100644
--- a/extension/content/firebug/console/commandHistory.js
+++ b/extension/content/firebug/console/commandHistory.js
@@ -24,7 +24,7 @@ Firebug.CommandHistory = function()
     const commandHistoryMax = 1000;
 
     var commandsPopup = Firebug.chrome.$("fbCommandHistory");
-    var commands = [];
+    var commands = this.commands = [];
     var commandPointer = 0;
     var commandInsertPointer = -1;
 
@@ -126,26 +126,29 @@ Firebug.CommandHistory = function()
         if(commands.length == 0)
             return;
 
-        var vbox = commandsPopup.ownerDocument.createElement("vbox");
+        var doc = commandsPopup.ownerDocument;
 
         for (var i = 0; i < commands.length; i++)
         {
-            var hbox = commandsPopup.ownerDocument.
-                createElementNS("http://www.w3.org/1999/xhtml", "div");
+            var hbox = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
 
             hbox.classList.add("commandHistoryItem");
             var shortExpr = Str.cropString(Str.stripNewLines(commands[i]), 50);
             hbox.innerHTML = Str.escapeForTextNode(shortExpr);
             hbox.value = i;
-            vbox.appendChild(hbox);
+            commandsPopup.appendChild(hbox);
 
             if (i === commandPointer)
                 this.selectCommand(hbox);
         }
 
-        commandsPopup.appendChild(vbox);
         commandsPopup.openPopup(element, "before_start", 0, 0, false, false);
 
+        // make sure last element is visible
+        var box = doc.getAnonymousNodes(commandsPopup)[0];
+        var scrollBox = doc.getAnonymousNodes(box)[1];
+        scrollBox.scrollTop = scrollBox.scrollHeight;
+
         return true;
     };
 
diff --git a/extension/content/firebug/firebug.css b/extension/content/firebug/firebug.css
index 5c134bb..9c87225 100644
--- a/extension/content/firebug/firebug.css
+++ b/extension/content/firebug/firebug.css
@@ -261,7 +261,8 @@ panelTab > panelTabMenu .menuPopup:-moz-locale-dir(rtl) {
     height: 20px;
 }
 
-#fbLocationList.noTabStop> menupopup > arrowscrollbox> scrollbox {
+#fbLocationList.noTabStop > menupopup > arrowscrollbox > scrollbox,
+#fbCommandHistory > arrowscrollbox > scrollbox {
     overflow-y: auto;
 }
 
diff --git a/extension/content/firebug/firebugOverlay.xul b/extension/content/firebug/firebugOverlay.xul
index daba10f..04ea828 100644
--- a/extension/content/firebug/firebugOverlay.xul
+++ b/extension/content/firebug/firebugOverlay.xul
@@ -36,8 +36,8 @@
             noautofocus="true">
         </panel>
 
-        <panel id="fbCommandHistory" noautofocus="true">
-        </panel>
+        <menupopup id="fbCommandHistory" noautofocus="true">
+        </menupopup>
 
         <!-- Context menu for the Command Editor -->
         <menupopup id="fbCommandEditorPopup" />
diff --git a/extension/skin/classic/win/firebug.css b/extension/skin/classic/win/firebug.css
index 96106de..1f67e3e 100644
--- a/extension/skin/classic/win/firebug.css
+++ b/extension/skin/classic/win/firebug.css
@@ -146,9 +146,11 @@
 
 #fbCommandHistory {
     min-width: 200px;
+    max-height: 800px;
     cursor: default;
     font-family: monospace;
     white-space: pre;
+    -moz-appearance: none;
 }
 
 .commandHistoryItem.selected {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list