@@ -10,7 +10,7 @@ const CoCreateRender = {
10
10
try {
11
11
if ( typeof json == 'undefined' || ! path )
12
12
return false ;
13
- if ( path . indexOf ( '.' ) == - 1 )
13
+ if ( path . indexOf ( '.' ) == - 1 && path . includes ( 'collection' ) )
14
14
json = this . dataOriginal
15
15
let jsonData = json , subpath = path . split ( '.' ) ;
16
16
@@ -64,18 +64,8 @@ const CoCreateRender = {
64
64
data [ renderKey ] [ 'collection' ] = this . dataOriginal [ renderKey ] [ 'collection' ]
65
65
66
66
let value = self . __getValue ( data , attr ) ;
67
- // if (value) {
68
- // if (value && typeof(value) !== "object") {
69
- // if (value && !Array.isArray(value)) {
70
67
if ( value ) {
71
- // converts object to string
72
- // if (!Array.isArray(value) && typeof(value) == "object") {
73
68
if ( typeof ( value ) == "object" ) {
74
- // let str = '';
75
- // for (const [key, val] of Object.entries(value)) {
76
- // str += `${key}: ${val}\n`;
77
- // }
78
-
79
69
value = this . generateString ( value )
80
70
}
81
71
isPass = true ;
@@ -117,7 +107,6 @@ const CoCreateRender = {
117
107
const renderKey = template . getAttribute ( 'render-key' ) || type ;
118
108
const self = this ;
119
109
120
- // const arrayData = this.__getValueFromObject(data, type);
121
110
let arrayData = data ;
122
111
123
112
const isRenderObject = template . hasAttribute ( 'render-object' ) ;
@@ -199,7 +188,6 @@ const CoCreateRender = {
199
188
attrValue = that . __replaceValue ( data , attrValue , renderKey ) ;
200
189
201
190
if ( attrValue || attrValue == "" ) {
202
- // el[renderPaceholder] = {attribute: attr_name ,placeholder: attr.value}
203
191
el . setAttribute ( attr_name , attrValue ) ;
204
192
}
205
193
} ) ;
@@ -246,12 +234,6 @@ const CoCreateRender = {
246
234
this . render ( elements [ 0 ] , data ) ;
247
235
else
248
236
this . setValue ( elements , data ) ;
249
- // for (let element of elements) {
250
- // if (element.classList.contains('template'))
251
- // this.render(element, data);
252
- // else
253
- // this.setValue([element], data);
254
- // }
255
237
}
256
238
257
239
}
0 commit comments