mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] config: make enableTransitions work on components (#773)
Fun: the transition is handled at two different places, once for dom nodes, once for components. Obviously, I only applied the change to the first case and forgot about the second.
This commit is contained in:
@@ -85,8 +85,9 @@ Note that if you work with Typescript, the `trigger` method is generic on the ty
|
|||||||
You can then describe the type of the event, so you will see typing errors...
|
You can then describe the type of the event, so you will see typing errors...
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
this.trigger<MyCustomPayload>('my-custom-event', payload);
|
this.trigger<MyCustomPayload>("my-custom-event", payload);
|
||||||
```
|
```
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
myCustomEventHandler(ev: OwlEvent<MyCustomPayload>) { ... }
|
myCustomEventHandler(ev: OwlEvent<MyCustomPayload>) { ... }
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ export class Component<Props extends {} = any, T extends Env = Env> {
|
|||||||
* up to the parent DOM nodes. Thus, it must be called between mounted() and
|
* up to the parent DOM nodes. Thus, it must be called between mounted() and
|
||||||
* willUnmount().
|
* willUnmount().
|
||||||
*/
|
*/
|
||||||
trigger<T=any>(eventType: string, payload?: T) {
|
trigger<T = any>(eventType: string, payload?: T) {
|
||||||
this.__trigger<T>(this, eventType, payload);
|
this.__trigger<T>(this, eventType, payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -227,7 +227,9 @@ QWeb.addDirective({
|
|||||||
if (name.startsWith("t-on-")) {
|
if (name.startsWith("t-on-")) {
|
||||||
events.push([name, value]);
|
events.push([name, value]);
|
||||||
} else if (name === "t-transition") {
|
} else if (name === "t-transition") {
|
||||||
transition = value;
|
if (QWeb.enableTransitions) {
|
||||||
|
transition = value;
|
||||||
|
}
|
||||||
} else if (!name.startsWith("t-")) {
|
} else if (!name.startsWith("t-")) {
|
||||||
if (name !== "class" && name !== "style") {
|
if (name !== "class" && name !== "style") {
|
||||||
// this is a prop!
|
// this is a prop!
|
||||||
|
|||||||
Reference in New Issue
Block a user