1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 00:27:58 +01:00

Closes issue #945.

This commit is contained in:
Kris Maglione
2013-01-05 19:02:08 -08:00
parent b02c4b39e6
commit b8f67ba32c
2 changed files with 15 additions and 3 deletions

View File

@@ -202,11 +202,11 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
commands.add(["redr[aw]"],
"Redraw the screen",
function () {
window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
.redraw();
statusline.overLink = null;
statusline.updateStatus();
commandline.clear();
window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
.redraw();
},
{ argCount: "0" });
},

View File

@@ -213,6 +213,7 @@ var CommandWidgets = Class("CommandWidgets", {
},
updateVisibility: function updateVisibility() {
let changed = 0;
for (let elem in values(this.elements))
if (elem.getGroup) {
let value = elem.getValue ? elem.getValue.call(this)
@@ -223,6 +224,7 @@ var CommandWidgets = Class("CommandWidgets", {
let meth, node = group[elem.name];
let visible = (value && group === activeGroup);
if (node && !node.collapsed == !visible) {
changed++;
node.collapsed = !visible;
if (elem.onVisibility)
elem.onVisibility.call(this, node, visible);
@@ -236,12 +238,22 @@ var CommandWidgets = Class("CommandWidgets", {
function check(node) {
if (DOM(node).style.display === "-moz-stack") {
let nodes = Array.filter(node.children, function (n) !n.collapsed && n.boxObject.height);
nodes.forEach(function (node, i) node.style.opacity = (i == nodes.length - 1) ? "" : "0");
nodes.forEach(function (node, i) { node.style.opacity = (i == nodes.length - 1) ? "" : "0" });
}
Array.forEach(node.children, check);
}
[this.commandbar.container, this.statusbar.container].forEach(check);
// Work around a redrawing bug.
if (changed && util.haveGecko("16")) {
util.delay(function () {
// Urgh.
statusline.statusBar.style.paddingRight = "1px";
DOM(statusline.statusBar).rect; // Force reflow.
statusline.statusBar.style.paddingRight = "";
}, 0);
}
if (this.initialized && loaded.mow && mow.visible)
mow.resize(false);
},