mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] blockdom: t-on supports synthetic and native event handler
Synthetic handler is a sort of event delegation that allows placing only one listener on the document to improve performance. It is an opt-in option. Native listener places the listener on the node itself.
This commit is contained in:
committed by
Aaron Bohy
parent
3eb63452e7
commit
2ae0149adb
@@ -1,7 +1,10 @@
|
||||
import { filterOutModifiersFromData } from "../blockdom/config";
|
||||
|
||||
export function mainEventHandler(data: any, ev: Event) {
|
||||
if (typeof data === "function") {
|
||||
data(ev);
|
||||
} else {
|
||||
data = filterOutModifiersFromData(data).data;
|
||||
const ctx = data[0];
|
||||
const method = data[1];
|
||||
const args = data[2] || [];
|
||||
|
||||
Reference in New Issue
Block a user