mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 02:17:59 +01:00
Closes issue #945.
This commit is contained in:
@@ -202,11 +202,11 @@ var Browser = Module("browser", XPCOM(Ci.nsISupportsWeakReference, ModuleBase),
|
|||||||
commands.add(["redr[aw]"],
|
commands.add(["redr[aw]"],
|
||||||
"Redraw the screen",
|
"Redraw the screen",
|
||||||
function () {
|
function () {
|
||||||
window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
|
|
||||||
.redraw();
|
|
||||||
statusline.overLink = null;
|
statusline.overLink = null;
|
||||||
statusline.updateStatus();
|
statusline.updateStatus();
|
||||||
commandline.clear();
|
commandline.clear();
|
||||||
|
window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
|
||||||
|
.redraw();
|
||||||
},
|
},
|
||||||
{ argCount: "0" });
|
{ argCount: "0" });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateVisibility: function updateVisibility() {
|
updateVisibility: function updateVisibility() {
|
||||||
|
let changed = 0;
|
||||||
for (let elem in values(this.elements))
|
for (let elem in values(this.elements))
|
||||||
if (elem.getGroup) {
|
if (elem.getGroup) {
|
||||||
let value = elem.getValue ? elem.getValue.call(this)
|
let value = elem.getValue ? elem.getValue.call(this)
|
||||||
@@ -223,6 +224,7 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
let meth, node = group[elem.name];
|
let meth, node = group[elem.name];
|
||||||
let visible = (value && group === activeGroup);
|
let visible = (value && group === activeGroup);
|
||||||
if (node && !node.collapsed == !visible) {
|
if (node && !node.collapsed == !visible) {
|
||||||
|
changed++;
|
||||||
node.collapsed = !visible;
|
node.collapsed = !visible;
|
||||||
if (elem.onVisibility)
|
if (elem.onVisibility)
|
||||||
elem.onVisibility.call(this, node, visible);
|
elem.onVisibility.call(this, node, visible);
|
||||||
@@ -236,12 +238,22 @@ var CommandWidgets = Class("CommandWidgets", {
|
|||||||
function check(node) {
|
function check(node) {
|
||||||
if (DOM(node).style.display === "-moz-stack") {
|
if (DOM(node).style.display === "-moz-stack") {
|
||||||
let nodes = Array.filter(node.children, function (n) !n.collapsed && n.boxObject.height);
|
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);
|
Array.forEach(node.children, check);
|
||||||
}
|
}
|
||||||
[this.commandbar.container, this.statusbar.container].forEach(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)
|
if (this.initialized && loaded.mow && mow.visible)
|
||||||
mow.resize(false);
|
mow.resize(false);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user