@webqit/oohtml 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-binding.js +17 -17
- package/dist/data-binding.js.map +2 -2
- package/dist/main.js +20 -20
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +20 -20
- package/dist/main.lite.js.map +2 -2
- package/package.json +1 -1
- package/src/data-binding/index.js +6 -4
package/package.json
CHANGED
|
@@ -172,6 +172,7 @@ const inlineParseCache = new Map;
|
|
|
172
172
|
function compileInlineBindings( config, str ) {
|
|
173
173
|
if ( inlineParseCache.has( str ) ) return inlineParseCache.get( str );
|
|
174
174
|
const validation = {};
|
|
175
|
+
let $event_i = -1;
|
|
175
176
|
const source = _splitOuter( str, ';' ).map( str => {
|
|
176
177
|
const [ left, right ] = _splitOuter( str, ':' ).map( x => x.trim() );
|
|
177
178
|
const directive = left[ 0 ], param = left.slice( 1 ).trim();
|
|
@@ -241,11 +242,12 @@ function compileInlineBindings( config, str ) {
|
|
|
241
242
|
}
|
|
242
243
|
// Events
|
|
243
244
|
if ( directive === '@' ) {
|
|
245
|
+
$event_i++;
|
|
244
246
|
return `
|
|
245
|
-
const handler = event => ${ right.startsWith('{') ? right : arg };
|
|
246
|
-
this.addEventListener( '${ param }', handler );
|
|
247
|
-
const abort = () => this.removeEventListener( '${ param }', handler );
|
|
248
|
-
this.$oohtml_internal_databinding_signals?.push( { abort } );
|
|
247
|
+
const handler${ $event_i } = event => ${ right.startsWith('{') ? right : arg };
|
|
248
|
+
this.addEventListener( '${ param }', handler${ $event_i } );
|
|
249
|
+
const abort${ $event_i } = () => this.removeEventListener( '${ param }', handler${ $event_i } );
|
|
250
|
+
this.$oohtml_internal_databinding_signals?.push( { abort: abort${ $event_i } } );
|
|
249
251
|
`;
|
|
250
252
|
}
|
|
251
253
|
// Functions
|