Roo/form/ComboBoxArray.js
[roojs1] / Roo / form / HtmlEditor.js
index b3e4c55..4bc9e52 100644 (file)
@@ -23,8 +23,8 @@ Roo.form.HtmlEditor = function(config){
 };
 
 /**
- * @class Ext.form.HtmlEditor
- * @extends Ext.form.Field
+ * @class Roo.form.HtmlEditor
+ * @extends Roo.form.Field
  * Provides a lightweight HTML Editor component.
  *
  * This has been tested on Fireforx / Chrome.. IE may not be so great..
@@ -35,6 +35,10 @@ Roo.form.HtmlEditor = function(config){
  * any element that has display set to 'none' can cause problems in Safari and Firefox.<br/><br/>
  */
 Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
+    /**
+     * @cfg {Boolean} clearUp
+     */
+    clearUp : true,
       /**
      * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one
      */
@@ -60,8 +64,6 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
      */
     stylesheets: false,
     
-    autosave : false,
-    
     // id of frame..
     frameId: false,
     
@@ -71,7 +73,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
     initialized : false,
     activated : false,
     
-//    onFocus : Roo.emptyFn,
+    onFocus : Roo.emptyFn,
     iframePad:3,
     hideMode:'offsets',
     
@@ -147,11 +149,17 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
              */
             firstfocus: true,
             /**
-             * @event focus
-             * Fires when on editor focus
+             * @event autosave
+             * Auto save the htmlEditor value as a file into Events
              * @param {HtmlEditor} this
              */
-            focus: true
+            autosave: true,
+            /**
+             * @event savedpreview
+             * preview the saved version of htmlEditor
+             * @param {HtmlEditor} this
+             */
+            savedpreview: true
         });
         this.defaultAutoCreate =  {
             tag: "textarea",
@@ -224,7 +232,7 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
             // should trigger onReize..
         }
         
-//        if(this.autosave){
+//        if(this.autosave && this.w){
 //            this.autoSaveFn = setInterval(this.autosave, 1000);
 //        }
     },
@@ -373,16 +381,15 @@ Roo.extend(Roo.form.HtmlEditor, Roo.form.Field, {
         
     },
     
-    // private
-    onFocus : function(e){
-        this.fireEvent('focus', this, e);
-         
-    },
-    
     // private
     syncValue : function()
     {
         this.editorcore.syncValue();
+    },
+    
+    pushValue : function()
+    {
+        this.editorcore.pushValue();
     }