fix word filter on html editor
[roojs1] / roojs-bootstrap-debug.js
index 7f9c067..98a354f 100644 (file)
@@ -16086,14 +16086,16 @@ Roo.extend(Roo.data.DataProxy, Roo.util.Observable);
  */
 /**
  * @class Roo.data.MemoryProxy
+ * @extends Roo.data.DataProxy
  * An implementation of Roo.data.DataProxy that simply passes the data specified in its constructor
  * to the Reader when its load method is called.
  * @constructor
- * @param {Object} data The data object which the Reader uses to construct a block of Roo.data.Records.
+ * @param {Object} config  A config object containing the objects needed for the Store to access data,
  */
-Roo.data.MemoryProxy = function(data){
-    if (data.data) {
-        data = data.data;
+Roo.data.MemoryProxy = function(config){
+    var data = config;
+    if (typeof(config) != 'undefined' && typeof(config.data) != 'undefined') {
+        data = config.data;
     }
     Roo.data.MemoryProxy.superclass.constructor.call(this);
     this.data = data;
@@ -16101,6 +16103,9 @@ Roo.data.MemoryProxy = function(data){
 
 Roo.extend(Roo.data.MemoryProxy, Roo.data.DataProxy, {
     
+    /**
+     *  @cfg {Object} data The data object which the Reader uses to construct a block of Roo.data.Records.
+     */
     /**
      * Load data from the requested source (in this case an in-memory
      * data object passed to the constructor), read the data object into
@@ -26625,6 +26630,8 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
         var lvl = 0;
         var stack = [ ul ];
         var last_li = false;
+        var base_lvl = 0;
+        
         items.forEach(function(n) {
             //Roo.log("got innertHMLT=" + n.innerHTML);
             
@@ -26658,11 +26665,20 @@ Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
             }
             
             var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1;
+            
+            
+            
             if (nlvl > lvl) {
                 //new indent
-                var nul = doc.createElement('ul'); // what about number lists...
-                last_li.appendChild(nul);
-                stack[nlvl] = nul;
+                if (last_li) {
+                    var nul = doc.createElement('ul'); // what about number lists...
+                    last_li.appendChild(nul);
+                    stack[nlvl] = nul;
+                } else {
+                    // occurs when we get a level (1) but no parent - just put all the children on the top most..
+                    stack[nlvl] = stack[stack.length-1]; 
+                }
+                
             }
             lvl = nlvl;