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

Fix finder scrolling bug introduced by revision 267fb6b1319e.

This commit is contained in:
Kris Maglione
2010-10-23 07:25:28 -04:00
parent 8eb6ce36ab
commit 1e941af1a6
2 changed files with 6 additions and 6 deletions

View File

@@ -54,7 +54,7 @@ const RangeFinder = Module("rangefinder", {
if (!this.rangeFind if (!this.rangeFind
|| this.rangeFind.window.get() != window || this.rangeFind.window.get() != window
|| linksOnly != !!this.rangeFind.elementPath || linksOnly != !!this.rangeFind.elementPath
|| regexp != this.rangeFind.regex || regexp != this.rangeFind.regexp
|| matchCase != this.rangeFind.matchCase || matchCase != this.rangeFind.matchCase
|| !!backward != this.rangeFind.reverse) { || !!backward != this.rangeFind.reverse) {
@@ -522,10 +522,10 @@ const RangeFind = Class("RangeFind", {
if (!this.matchCase) if (!this.matchCase)
word = word.toLowerCase(); word = word.toLowerCase();
if (!again && (word == "" || word.indexOf(this.lastString) != 0 || this.backward)) { if (!again && (word === "" || word.indexOf(this.lastString) !== 0 || this.backward)) {
if (!private_) if (!private_)
this.range.deselect(); this.range.deselect();
if (word == "") if (word === "")
this.range.descroll(); this.range.descroll();
this.lastRange = this.startRange; this.lastRange = this.startRange;
this.range = this.ranges.first; this.range = this.ranges.first;

View File

@@ -382,7 +382,7 @@ const Hints = Module("hints", {
let activeHint = this._hintNumber || 1; let activeHint = this._hintNumber || 1;
this._validHints = []; this._validHints = [];
for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let { doc, start, end } in values(this._docs)) {
let [offsetX, offsetY] = this._getContainerOffsets(doc); let [offsetX, offsetY] = this._getContainerOffsets(doc);
inner: inner:
@@ -438,7 +438,7 @@ const Hints = Module("hints", {
if (options["usermode"]) { if (options["usermode"]) {
let css = []; let css = [];
// FIXME: Broken for imgspans. // FIXME: Broken for imgspans.
for (let [, { doc: doc }] in Iterator(this._docs)) { for (let { doc } in values(this._docs)) {
for (let elem in util.evaluateXPath("//*[@dactyl:highlight and @number]", doc)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight and @number]", doc)) {
let group = elem.getAttributeNS(NS, "highlight"); let group = elem.getAttributeNS(NS, "highlight");
css.push(highlight.selector(group) + "[number=" + elem.getAttribute("number").quote() + "] { " + elem.style.cssText + " }"); css.push(highlight.selector(group) + "[number=" + elem.getAttribute("number").quote() + "] { " + elem.style.cssText + " }");
@@ -459,7 +459,7 @@ const Hints = Module("hints", {
* hint disappears. * hint disappears.
*/ */
_removeHints: function _removeHints(timeout, slight) { _removeHints: function _removeHints(timeout, slight) {
for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { for (let { doc, start, end } in values(this._docs)) {
for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc))
elem.parentNode.removeChild(elem); elem.parentNode.removeChild(elem);
for (let i in util.range(start, end + 1)) for (let i in util.range(start, end + 1))