Roo/form/HtmlEditor.js
authorEdward <edward@roojs.com>
Mon, 8 Jun 2015 06:31:25 +0000 (14:31 +0800)
committerEdward <edward@roojs.com>
Mon, 8 Jun 2015 06:31:25 +0000 (14:31 +0800)
Roo/form/HtmlEditor.js

index c652580..4b1a32a 100644 (file)
@@ -264,10 +264,11 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
                 Roo.log('TAB');
                 
                 var value = this.getValue();
+                
                 var start = this.el.dom.selectionStart;
-                var end = value.length;
+                var end = this.el.dom.selectionEnd;
                 
-                this.setValue()
+                this.setValue(value.substring(0, start) + "\t" + value.substring(end));
                 
             },