1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 17:57:58 +01:00
This commit is contained in:
Kris Maglione
2012-01-27 10:20:21 -05:00
parent 97ff27f575
commit cbb748f5dd
3 changed files with 14 additions and 11 deletions

View File

@@ -532,6 +532,7 @@ var HintSession = Class("HintSession", CommandMode, {
*/
removeHints: function _removeHints(timeout) {
for (let { doc, start, end } in values(this.docs)) {
DOM(doc.documentElement).highlight.remove("Hinting");
// Goddamn stupid fucking Gecko 1.x security manager bullshit.
try { delete doc.dactylLabels; } catch (e) { doc.dactylLabels = undefined; }
@@ -574,6 +575,7 @@ var HintSession = Class("HintSession", CommandMode, {
this.validHints = [];
for (let { doc, start, end } in values(this.docs)) {
DOM(doc.documentElement).highlight.add("Hinting");
let [offsetX, offsetY] = this.getContainerOffsets(doc);
inner:
@@ -590,13 +592,13 @@ var HintSession = Class("HintSession", CommandMode, {
if (!rect)
continue;
hint.imgSpan = util.xmlToDom(<span highlight="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc);
hint.imgSpan.style.display = "none";
hint.imgSpan.style.left = (rect.left + offsetX) + "px";
hint.imgSpan.style.top = (rect.top + offsetY) + "px";
hint.imgSpan.style.width = (rect.right - rect.left) + "px";
hint.imgSpan.style.height = (rect.bottom - rect.top) + "px";
hint.span.parentNode.appendChild(hint.imgSpan);
hint.imgSpan = DOM(<span highlight="Hint" dactyl:hl="HintImage" xmlns:dactyl={NS}/>, doc).css({
display: "none",
left: (rect.left + offsetX) + "px",
top: (rect.top + offsetY) + "px",
width: (rect.right - rect.left) + "px",
height: (rect.bottom - rect.top) + "px"
}).appendTo(hint.span.parentNode)[0];
}
}