[IMP] qweb, blockdom, components: t-on with modifiers

supported modifiers: capture, prevent, stop, self.
This commit is contained in:
Lucas Perais (lpe)
2021-10-27 14:45:29 +02:00
committed by Aaron Bohy
parent 2ae0149adb
commit 4cceb239dd
11 changed files with 427 additions and 39 deletions
+2 -1
View File
@@ -16,12 +16,13 @@ export const config = {
// this is the main event handler. Every event handler registered with blockdom
// will go through this function, giving it the data registered in the block
// and the event
mainEventHandler: (data: any, ev: Event) => {
mainEventHandler: (data: any, ev: Event, currentTarget?: EventTarget | null): boolean => {
if (typeof data === "function") {
data(ev);
} else if (Array.isArray(data)) {
data = filterOutModifiersFromData(data).data;
data[0](data[1], ev);
}
return false;
},
};