Display nodes only when there's somewhere to put the display
This commit is contained in:
parent
caa9d39618
commit
a524f0a06b
|
@ -16,6 +16,8 @@ assertion type OverlayLink(downNode, upNode);
|
||||||
assertion type OverlayNode(id);
|
assertion type OverlayNode(id);
|
||||||
assertion type OverlayRoot();
|
assertion type OverlayRoot();
|
||||||
|
|
||||||
|
assertion type DisplayingNode(nodeDescription);
|
||||||
|
|
||||||
spawn {
|
spawn {
|
||||||
const ui = new UI.Anchor();
|
const ui = new UI.Anchor();
|
||||||
assert ui.html('body',
|
assert ui.html('body',
|
||||||
|
@ -86,15 +88,20 @@ spawn {
|
||||||
<ul class="root"></ul>
|
<ul class="root"></ul>
|
||||||
<ul class="vaddrs"></ul>
|
<ul class="vaddrs"></ul>
|
||||||
</div>);
|
</div>);
|
||||||
|
assert DisplayingNode(OverlayRoot());
|
||||||
const nodeName = (n) => {
|
const nodeName = (n) => {
|
||||||
if (OverlayNode.isClassOf(n)) return "node_" + Bytes.from(OverlayNode._id(n)).toHex();
|
if (OverlayNode.isClassOf(n)) return "node_" + Bytes.from(OverlayNode._id(n)).toHex();
|
||||||
return "root";
|
return "root";
|
||||||
};
|
};
|
||||||
during FromServer(addr, $item(OverlayLink($down, $up))) {
|
during FromServer(addr, $item(OverlayLink($down, $up))) {
|
||||||
console.log(down.toString(), '-->', up.toString());
|
console.log(down.toString(), 'waiting for', up.toString());
|
||||||
const ui = new UI.Anchor();
|
during DisplayingNode(up) {
|
||||||
assert ui.html(`#overlays div.o_${scope} ul.${nodeName(up)}`,
|
console.log(down.toString(), 'sees', up.toString());
|
||||||
<li><tt>{down.toString()}</tt><ul class={nodeName(down)}></ul></li>);
|
const ui = new UI.Anchor();
|
||||||
|
assert ui.html(`#overlays div.o_${scope} ul.${nodeName(up)}`,
|
||||||
|
<li><tt>{down.toString()}</tt><ul class={nodeName(down)}></ul></li>);
|
||||||
|
assert DisplayingNode(down);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
during FromServer(addr, $item(AddressMap(_, _, _))) {
|
during FromServer(addr, $item(AddressMap(_, _, _))) {
|
||||||
const ui = new UI.Anchor();
|
const ui = new UI.Anchor();
|
||||||
|
|
Loading…
Reference in New Issue