aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranekos2008-11-25 09:32:23 +0000
committeranekos2008-11-25 09:32:23 +0000
commit8de7e274007bc23f777f1898f8bb2613bd7deb32 (patch)
treebf330450f79e3af7bee0d4b013ce381e1e6165c1
parent30c48027fff83ba4bafb02e9e5c93a2e75b2e7f0 (diff)
downloadvimperator-plugins-8de7e274007bc23f777f1898f8bb2613bd7deb32.tar.bz2
フレームに対応
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24838 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--walk-input.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/walk-input.js b/walk-input.js
index 77ff522..7a228d4 100644
--- a/walk-input.js
+++ b/walk-input.js
@@ -35,13 +35,14 @@ var walkinput = function (forward) {
let r = doc.evaluate(xpath, doc, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0, l = r.snapshotLength; i < l; ++i) {
let e = r.snapshotItem(i);
- list.push(e);
+ let ef = {element: e, frame: frame};
+ list.push(ef);
if (e == focused) {
- current = e;
+ current = ef;
} else if (current && !next) {
- next = e;
+ next = ef;
} else if (!current) {
- prev = e;
+ prev = ef;
}
}
}
@@ -54,7 +55,10 @@ var walkinput = function (forward) {
var elem = forward ? (next || list[0])
: (prev || list[list.length - 1]);
- elem.focus();
+
+ if (!current || current.frame != elem.frame)
+ elem.frame.focus();
+ elem.element.focus();
};