diff options
author | anekos | 2009-03-01 05:17:34 +0000 |
---|---|---|
committer | anekos | 2009-03-01 05:17:34 +0000 |
commit | 70e2e925566cde1699e88f13939570c56e2db1ec (patch) | |
tree | 28c9a53425a94992bb160477b17df568a537af22 | |
parent | 63458774610c20c75017abe4749732be4e413711 (diff) | |
download | vimperator-plugins-70e2e925566cde1699e88f13939570c56e2db1ec.tar.bz2 |
getBoundingClientRect の存在を忘れていた
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@30634 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r-- | reveal-ie-ctrl-a-images.js | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/reveal-ie-ctrl-a-images.js b/reveal-ie-ctrl-a-images.js index 87466a6..3e16743 100644 --- a/reveal-ie-ctrl-a-images.js +++ b/reveal-ie-ctrl-a-images.js @@ -38,7 +38,7 @@ let PLUGIN_INFO = <name>Reveal Image</name> <description>Reveal IE Ctrl-A images.</description> <description lang="ja">IE の Ctrl-A 画像を暴く</description> - <version>1.0.1</version> + <version>1.0.2</version> <author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author> <license>new BSD License (Please read the source code comments of this plugin)</license> <license lang="ja">修正BSDライセンス (ソースコードのコメントを参照してください)</license> @@ -78,27 +78,14 @@ let PLUGIN_INFO = let (v = liberator.globalVariables[name]) (v === undefined ? def : v); - function getPosition (elem) { + function getAbsPosition (elem) { + let rect = elem.getBoundingClientRect(); return { - x: elem.offsetLeft || 0, - y: elem.offsetTop || 0 + x: Math.max((rect.left + content.scrollX), content.scrollX), + y: Math.max((rect.top + content.scrollY), content.scrollY), }; } - function getAbsPosition (elem) { - let p = getPosition(elem); - liberator.log(p) - if (elem.offsetParent) { - let q = getAbsPosition(elem.offsetParent); - return { - x: p.x + q.x, - y: p.y + q.y, - }; - } else { - return p; - } - } - function reveal (elem, sec, zura) { if (sec <= 0) sec = 5; |