1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 11:27:58 +01:00
This commit is contained in:
Kris Maglione
2008-11-26 05:47:02 +00:00
parent b38fff6137
commit 988e88268e
3 changed files with 16 additions and 23 deletions

View File

@@ -38,9 +38,9 @@ function Highlights(name, store, serial)
CompResult width: 45%; overflow: hidden; CompResult width: 45%; overflow: hidden;
CompDesc color: gray; width: 50%; CompDesc color: gray; width: 50%;
CompLess text-align: center; height: .5ex; line-height: .5ex; CompLess text-align: center; height: .5ex; line-height: .5ex;
CompLess:after content: "\2303" CompLess:after content: "\2303" /* Unicode up arrowhead */
CompMore text-align: center; height: .5ex; line-height: .5ex; padding-bottom: 1ex; CompMore text-align: center; height: .5ex; line-height: .5ex; padding-bottom: 1ex;
CompMore:after content: "\2304" CompMore:after content: "\2304" /* Unicode down arrowhead */
Indicator color: blue; Indicator color: blue;
Filter font-weight: bold; Filter font-weight: bold;

View File

@@ -49,6 +49,10 @@ const template = {
} }
return <div class={class || "hl-CompItem"}> return <div class={class || "hl-CompItem"}>
<!-- The non-breaking spaces prevent empty elements
- from pushing the baseline down and enlarging
- the row.
-->
<li class="hl-CompResult">{text}&#160;</li> <li class="hl-CompResult">{text}&#160;</li>
<li class="hl-CompDesc">{desc}&#160;</li> <li class="hl-CompDesc">{desc}&#160;</li>
</div>; </div>;

View File

@@ -1324,16 +1324,13 @@ function ItemList(id) //{{{
} }
</div> </div>
</div>, divNodes); </div>, divNodes);
// 1:
doc.body.replaceChild(div, doc.body.firstChild); doc.body.replaceChild(div, doc.body.firstChild);
// 2:
items.contextList.forEach(function init_eachContext(context) { items.contextList.forEach(function init_eachContext(context) {
if (!context.items.length) if (!context.items.length)
return; return;
context.cache.nodes = {}; context.cache.nodes = {};
context.cache.dom = dom(<div> dom(<div key="root">
<div class="hl-Completions"> <div class="hl-Completions">
{context.createRow(context.title || [], "hl-CompTitle")} {context.createRow(context.title || [], "hl-CompTitle")}
</div> </div>
@@ -1341,7 +1338,7 @@ function ItemList(id) //{{{
<div key="items"/> <div key="items"/>
<div key="down" class="hl-CompMore"/> <div key="down" class="hl-CompMore"/>
</div>, context.cache.nodes); </div>, context.cache.nodes);
divNodes.completions.appendChild(context.cache.dom); divNodes.completions.appendChild(context.cache.nodes.root);
}); });
} }
@@ -1374,32 +1371,24 @@ function ItemList(id) //{{{
} }
items.contextList.forEach(function fill_eachContext(context) { items.contextList.forEach(function fill_eachContext(context) {
let cache = context.cache; let nodes = context.cache.nodes;
let dom = cache.dom; if (!nodes)
if (!dom)
return; return;
let dom = nodes.root
let [start, end] = getRows(context); let [start, end] = getRows(context);
let d = stuff.cloneNode(true); let d = stuff.cloneNode(true);
for (let [,row] in Iterator(context.getRows(start, end, doc))) for (let [,row] in Iterator(context.getRows(start, end, doc)))
d.appendChild(row); d.appendChild(row);
dom.replaceChild(d, cache.nodes.items); dom.replaceChild(d, nodes.items);
cache.nodes.items = d; nodes.items = d;
cache.nodes.up.style.display = (start == 0) ? "none" : "block"; nodes.up.style.display = (start == 0) ? "none" : "block";
cache.nodes.down.style.display = (end == context.items.length) ? "none" : "block"; nodes.down.style.display = (end == context.items.length) ? "none" : "block";
}); });
divNodes.noCompletions.style.display = off > 0 ? "none" : "block"; divNodes.noCompletions.style.display = (off > 0) ? "none" : "block";
// 1:
completionElements = div.getElementsByClassName("hl-CompItem"); completionElements = div.getElementsByClassName("hl-CompItem");
// 2:
//let node = div.cloneNode(true);
//completionElements = node.getElementsByClassName("hl-CompItem");
//completionBody = node.getElementsByTagName("div")[1];
//doc.body.replaceChild(node, doc.body.firstChild);
//completionElements = node.getElementsByClassName("hl-CompItem");
autoSize(); autoSize();
return true; return true;
} }