Skip to content
Browse files

Merge pull request #27 from firebug/scrollbar_bugs

Issue 5725 (Command history isn't displayed correctly when there are too many commands in it)
http://code.google.com/p/fbug/issues/detail?id=5725
  • Loading branch information...
2 parents d43708b + d89b323 commit 1e1137152a5f8e50b9e2679341cba519bb9920e1 @SebastianZ SebastianZ committed
View
15 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;
};
View
4 extension/content/firebug/console/commandLine.js
@@ -450,6 +450,10 @@ Firebug.CommandLine = Obj.extend(Firebug.Module,
if (noscript && noScriptURI)
noscript.setJSEnabled(noScriptURI, false);
+
+ var consolePanel = Firebug.currentContext.panelMap.console;
+ if (consolePanel)
+ Dom.scrollToBottom(consolePanel.panelNode);
},
enterInspect: function(context)
View
4 extension/content/firebug/console/consolePanel.js
@@ -155,12 +155,12 @@ Firebug.ConsolePanel.prototype = Obj.extend(Firebug.ActivablePanel,
if (state)
wasScrolledToBottom = state.wasScrolledToBottom;
- if (typeof(wasScrolledToBottom) == "boolean")
+ if (typeof wasScrolledToBottom == "boolean")
{
this.wasScrolledToBottom = wasScrolledToBottom;
delete state.wasScrolledToBottom;
}
- else
+ else if (typeof this.wasScrolledToBottom != "boolean")
{
// If the previous state doesn't says where to scroll,
// scroll to the bottom by default.
View
3 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;
}
View
2 extension/content/firebug/firebug.js
@@ -1719,9 +1719,11 @@ Firebug.Panel = Obj.extend(new Firebug.Listener(),
if (this.panelNode)
{
+ var scrollTop = this.panelNode.scrollTop;
this.panelNode = doc.adoptNode(this.panelNode, true);
this.panelNode.ownerPanel = this;
doc.body.appendChild(this.panelNode);
+ this.panelNode.scrollTop = scrollTop;
}
},
View
4 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" />
View
2 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 {

0 comments on commit 1e11371

Please sign in to comment.
Something went wrong with that request. Please try again.