1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 07:27:58 +01:00

inline odd buffer.getElement - only used in liberator.help

This commit is contained in:
Doug Kearns
2008-10-30 04:39:44 +00:00
parent b160ef7317
commit fd0d20b42c
2 changed files with 2 additions and 9 deletions

View File

@@ -886,9 +886,9 @@ const liberator = (function () //{{{
function jumpToTag(file, tag)
{
liberator.open("chrome://liberator/locale/" + file, where);
// TODO: it would be better wo wait for pageLoad
// TODO: it would be better to wait for pageLoad
setTimeout(function () {
var elem = buffer.getElement('@class="tag" and text()="' + tag + '"');
let elem = buffer.evaluateXPath("//*[@class='tag' and text()='" + tag + "']").snapshotItem(0);
if (elem)
window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context
else