From 754938e2f2043a7f42952356e3b231db3b19cc33 Mon Sep 17 00:00:00 2001
From: suVene
Date: Mon, 12 Jan 2009 15:33:55 +0000
Subject: mod clientWidth to offsetWidth
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28332 d0d07461-0603-4401-acd4-de1884942a52
---
resizable_textarea.js | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
(limited to 'resizable_textarea.js')
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 =
Allows you to resize textareas.
テキストエリアをリサイズ可能にする。
suVene
- 0.2.0
+ 0.2.1
MIT
2.0pre
2.0α2
@@ -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("");
+mappings.addUserMap(
[ modes.INSERT, modes.TEXTAREA ],
[ "", "" ],
"Allows you to resize current textarea.",
--
cgit v1.2.3