Roo/form/HtmlEditor.js
authorAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 06:46:49 +0000 (14:46 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 06:46:49 +0000 (14:46 +0800)
Roo/form/HtmlEditor.js

index e27d058..379920d 100644 (file)
@@ -636,7 +636,18 @@ Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
     insertTag : function(tg)
     {
         // could be a bit smarter... -> wrap the current selected tRoo..
-        
+        if (tg.toLowerCase() == 'span') {
+            
+            range = this.createRange(this.getSelection());
+            var wrappingNode = this.doc.createElement("span");
+            wrappingNode.appendChild(range.extractContents());
+            range.insertNode(wrappingNode);
+
+            return;
+            
+            
+            
+        }
         this.execCmd("formatblock",   tg);
         
     },