aboutsummaryrefslogtreecommitdiffstats
path: root/resizable_textarea.js
diff options
context:
space:
mode:
authorsuVene2009-01-12 15:33:55 +0000
committersuVene2009-01-12 15:33:55 +0000
commit754938e2f2043a7f42952356e3b231db3b19cc33 (patch)
treeab5fbb156d1682134e6cc95cbc55e7aae27d2353 /resizable_textarea.js
parente8ccd2eecf03e649089f2a2f0710eab963e26472 (diff)
downloadvimperator-plugins-754938e2f2043a7f42952356e3b231db3b19cc33.tar.bz2
mod clientWidth to offsetWidth
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28332 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'resizable_textarea.js')
-rw-r--r--resizable_textarea.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/resizable_textarea.js b/resizable_textarea.js
index e1e698e..7958a06 100644
--- a/resizable_textarea.js
+++ b/resizable_textarea.js
@@ -11,7 +11,7 @@ var PLUGIN_INFO =
<description>Allows you to resize textareas.</description>
<description lang="ja">テキストエリアをリサイズ可能にする。</description>
<author mail="suvene@zeromemory.info" homepage="http://zeromemory.sblo.jp/">suVene</author>
- <version>0.2.0</version>
+ <version>0.2.1</version>
<license>MIT</license>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0α2</maxVersion>
@@ -120,17 +120,17 @@ TextResizer.prototype = {
switch (event.keyCode) {
case KeyEvent.DOM_VK_UP: case KeyEvent.DOM_VK_K:
if (nodeName == "textarea")
- this.target.style.height = this.target.clientHeight - 10 + "px";
+ this.target.style.height = this.target.offsetHeight - 10 + "px";
break;
case KeyEvent.DOM_VK_DOWN: case KeyEvent.DOM_VK_J:
if (nodeName == "textarea")
- this.target.style.height = this.target.clientHeight + 15 + "px";
+ this.target.style.height = this.target.offsetHeight + 10 + "px";
break;
case KeyEvent.DOM_VK_LEFT: case KeyEvent.DOM_VK_H:
- this.target.style.width = this.target.clientWidth - 10 + "px";
+ this.target.style.width = this.target.offsetWidth - 10 + "px";
break;
case KeyEvent.DOM_VK_RIGHT: case KeyEvent.DOM_VK_L:
- this.target.style.width = this.target.clientWidth + 15 + "px";
+ this.target.style.width = this.target.offsetWidth + 10 + "px";
break;
case KeyEvent.DOM_VK_RETURN: case KeyEvent.DOM_VK_ENTER: case KeyEvent.DOM_VK_ESCAPE:
this.target.style.background = this.target.startBgColor;
@@ -166,7 +166,8 @@ commands.addUserCommand(
true
);
-mappings.add(
+mappings.remove("<A-r>");
+mappings.addUserMap(
[ modes.INSERT, modes.TEXTAREA ],
[ "<M-r>", "<A-r>" ],
"Allows you to resize current textarea.",