|
|
@@ -71,24 +71,18 @@ export default {
|
|
71
|
71
|
// Add the top-level blocks to the document tree
|
|
72
|
72
|
treeToAppend = new DocumentFragment()
|
|
73
|
73
|
this.root = document.createElement('div')
|
|
74
|
|
- // console.log(this.block)
|
|
75
|
74
|
this.root.classList.add('wp-block-columns')
|
|
76
|
75
|
treeToAppend.appendChild(this.root)
|
|
77
|
76
|
|
|
78
|
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
|
83
|
mounted() {
|
|
90
|
|
- // Append the final product to DOM
|
|
91
|
84
|
this.buildBlocks()
|
|
|
85
|
+ // Append the final product to DOM
|
|
92
|
86
|
document.getElementById(`block-${this.$.uid}`).innerHTML = ''
|
|
93
|
87
|
document.getElementById(`block-${this.$.uid}`).appendChild(treeToAppend)
|
|
94
|
88
|
},
|