mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 17:16:12 +00:00
Attempt to fix bug 385545 - toolbar folder contents aren't visible some time after loading. r=dietrich, a=mconnor.
This commit is contained in:
parent
2f9b04b886
commit
2f896221de
@ -302,6 +302,9 @@
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_ASSERT(this._resultNode.containerOpen,
|
||||
"container must be opened when _rebuild is called");
|
||||
|
||||
var cc = this._resultNode.childCount;
|
||||
if (cc > 0) {
|
||||
for (var i = 0; i < cc; ++i) {
|
||||
@ -438,24 +441,44 @@
|
||||
},
|
||||
|
||||
containerOpened: function PMV_containerOpened(aNode) {
|
||||
if (aNode == this._self.getResultNode())
|
||||
this._self._rebuild();
|
||||
else
|
||||
this._forwardToChildView(aNode, "containerOpened", arguments);
|
||||
this.invalidateContainer(aNode);
|
||||
},
|
||||
|
||||
containerClosed: function PMV_containerClosed(aNode) {
|
||||
this.invalidateContainer(aNode);
|
||||
},
|
||||
|
||||
invalidateContainer: function PMV_invalidateContainer(aNode) {
|
||||
if (aNode == this._self.getResultNode())
|
||||
this._self._rebuild();
|
||||
else {
|
||||
this._forwardToChildView(aNode, "invalidateContainer", arguments);
|
||||
invalidateContainer: function PMV_invalidateContainer(aContainer) {
|
||||
function isChildOf(node, container) {
|
||||
var parent = node.parent;
|
||||
while (parent) {
|
||||
if (parent == container)
|
||||
return true;
|
||||
parent = parent.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var viewerToRebuild = null;
|
||||
for (var i=0; i < this._self._containerNodesMap.length; i++) {
|
||||
var node = this._self._containerNodesMap[i].resultNode;
|
||||
|
||||
if (node == aContainer)
|
||||
viewerToRebuild = this._self._containerNodesMap[i].domNode._viewer;
|
||||
if (isChildOf(node, aContainer))
|
||||
this._self._containerNodesMap.splice(i,1);
|
||||
}
|
||||
|
||||
if (aContainer.containerOpen) {
|
||||
if (viewerToRebuild)
|
||||
viewerToRebuild._self._rebuild();
|
||||
else
|
||||
this._self._rebuild();
|
||||
}
|
||||
},
|
||||
|
||||
invalidateAll: function PMV_invalidateAll() {
|
||||
this._self._containerNodesMap.splice(0);
|
||||
this._self._rebuild();
|
||||
},
|
||||
|
||||
|
@ -200,7 +200,6 @@
|
||||
while (this.hasChildNodes())
|
||||
this.removeChild(this.firstChild);
|
||||
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
this._result.root.containerOpen = true;
|
||||
var cc = this._result.root.childCount;
|
||||
for (var i = 0; i < cc; ++i)
|
||||
this.insertNewItem(this._result.root.getChild(i), null);
|
||||
@ -612,23 +611,44 @@
|
||||
},
|
||||
|
||||
containerOpened: function TV_V_containerOpened(aNode) {
|
||||
if (aNode == this._self.getResult().root)
|
||||
this._self._rebuild();
|
||||
else
|
||||
this._forwardToChildView(aNode, "containerOpened", arguments);
|
||||
this.invalidateContainer(aNode);
|
||||
},
|
||||
|
||||
containerClosed: function TV_V_containerClosed(aNode) {
|
||||
this.invalidateContainer(aNode);
|
||||
},
|
||||
|
||||
invalidateContainer: function TV_V_invalidateContainer(aNode) {
|
||||
if (aNode == this._self.getResult().root)
|
||||
this._self._rebuild();
|
||||
else
|
||||
this._forwardToChildView(aNode, "invalidateContainer", arguments);
|
||||
invalidateContainer: function TV_V_invalidateContainer(aContainer) {
|
||||
function isChildOf(node, container) {
|
||||
var parent = node.parent;
|
||||
while (parent) {
|
||||
if (parent == container)
|
||||
return true;
|
||||
parent = parent.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var viewerToRebuild = null;
|
||||
for (var i=0; i < this._self._containerNodesMap.length; i++) {
|
||||
var node = this._self._containerNodesMap[i].resultNode;
|
||||
|
||||
if (node == aContainer)
|
||||
viewerToRebuild = this._self._containerNodesMap[i].domNode._viewer;
|
||||
if (isChildOf(node, aContainer))
|
||||
this._self._containerNodesMap.splice(i,1);
|
||||
}
|
||||
|
||||
if (aContainer.containerOpen) {
|
||||
if (viewerToRebuild)
|
||||
viewerToRebuild._self._rebuild();
|
||||
else
|
||||
this._self._rebuild();
|
||||
}
|
||||
},
|
||||
|
||||
invalidateAll: function TV_V_invalidateAll() {
|
||||
this._self._containerNodesMap.splice(0);
|
||||
this._self._rebuild();
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user