File tree 2 files changed +4
-16
lines changed
2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -197,12 +197,12 @@ export default class Entity {
197
197
return 'Entity' + Date . now ( ) + Math . floor ( Math . random ( ) * 10000 )
198
198
}
199
199
200
- async init ( shouldAdd = false ) {
200
+ async init ( ) {
201
201
this . getVariables ( )
202
202
this . applyEventBindings ( )
203
203
await this . evaluateAll ( )
204
204
205
- if ( shouldAdd || ! this . isInsideEachElement ( ) ) MiniJS . elements . push ( this )
205
+ MiniJS . elements . push ( this )
206
206
}
207
207
208
208
initChildren ( ) {
@@ -214,24 +214,13 @@ export default class Entity {
214
214
215
215
try {
216
216
const entity = new Entity ( element )
217
- entity . init ( true )
217
+ entity . init ( )
218
218
} catch ( error ) {
219
219
console . error ( 'Failed to initialize child entity:' , error )
220
220
}
221
221
}
222
222
}
223
223
224
- isInsideEachElement ( ) {
225
- let value = this . element . parentElement
226
-
227
- while ( value ) {
228
- if ( value . hasAttribute && value . hasAttribute ( ':each' ) ) return true
229
- value = value . parentElement
230
- }
231
-
232
- return false
233
- }
234
-
235
224
async evaluateEventAction ( attrName ) {
236
225
const attrVal = this . element . getAttribute ( attrName )
237
226
await this . _interpret ( attrVal )
Original file line number Diff line number Diff line change @@ -201,8 +201,7 @@ const MiniJS = (() => {
201
201
if ( elem . nodeType !== 1 ) continue
202
202
203
203
const entity = new Entity ( elem )
204
-
205
- if ( ! entity . isInsideEachElement ( ) ) _elements . push ( entity )
204
+ _elements . push ( entity )
206
205
}
207
206
}
208
207
You can’t perform that action at this time.
0 commit comments