]> wagnertech.de Git - mfinanz.git/blobdiff - js/kivi.js
AreaInputTag: kleines Icon neben Input zum Umschalten auf Textarea
[mfinanz.git] / js / kivi.js
index 41b3762a36feae20ef9630358e3a3e9dce94bca5..fbe0c953beb3dcfb02e2933726db21a414c59e9f 100644 (file)
@@ -535,6 +535,23 @@ namespace("kivi", function(ns) {
 
     return true;
   };
+
+  ns.switch_areainput_to_textarea = function(id) {
+    var $input = $('#' + id);
+    if (!$input.length)
+      return;
+
+    var $area = $('<textarea></textarea>');
+
+    $area.prop('rows', 3);
+    $area.prop('cols', $input.prop('size') || 40);
+    $area.prop('name', $input.prop('name'));
+    $area.prop('id',   $input.prop('id'));
+    $area.val($input.val());
+
+    $input.parent().replaceWith($area);
+    $area.focus();
+  };
 });
 
 kivi = namespace('kivi');