Переглянути джерело

:bug: fixed blocks with recursive structure | #66 | #42

tags/0.9.0
j 4 роки тому
джерело
коміт
d7b4d26d0e

+ 3
- 9
vue-theme/src/components/content-block/block-recursive.vue Переглянути файл

71
             // Add the top-level blocks to the document tree
71
             // Add the top-level blocks to the document tree
72
             treeToAppend = new DocumentFragment()
72
             treeToAppend = new DocumentFragment()
73
             this.root = document.createElement('div')
73
             this.root = document.createElement('div')
74
-            // console.log(this.block)
75
             this.root.classList.add('wp-block-columns')
74
             this.root.classList.add('wp-block-columns')
76
             treeToAppend.appendChild(this.root)
75
             treeToAppend.appendChild(this.root)
77
 
76
 
78
             // Loop over all the nodes and append children
77
             // Loop over all the nodes and append children
79
-            if(this.block.length == 1) {
80
-                for(const block of this.block) {
81
-                    this.processBlock(block, this.root)
82
-                }
83
-            }
84
-            else {
85
-                console.warn('more than one block in here')
78
+            for(const block of this.block) {
79
+                this.processBlock(block, this.root)
86
             }
80
             }
87
         },
81
         },
88
     },
82
     },
89
     mounted() {
83
     mounted() {
90
-        // Append the final product to DOM
91
         this.buildBlocks()
84
         this.buildBlocks()
85
+        // Append the final product to DOM
92
         document.getElementById(`block-${this.$.uid}`).innerHTML = ''
86
         document.getElementById(`block-${this.$.uid}`).innerHTML = ''
93
         document.getElementById(`block-${this.$.uid}`).appendChild(treeToAppend)
87
         document.getElementById(`block-${this.$.uid}`).appendChild(treeToAppend)
94
     },
88
     },

Завантаження…
Відмінити
Зберегти