From 59f401303a9601bc4738bb71a7a9465099393c67 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 16 May 2019 14:05:01 +0200 Subject: [PATCH] [REF] transitions: remove create hook --- src/qweb_extensions.ts | 6 +----- tests/__snapshots__/qweb.test.ts.snap | 6 ------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/qweb_extensions.ts b/src/qweb_extensions.ts index 837493a9..712612b4 100644 --- a/src/qweb_extensions.ts +++ b/src/qweb_extensions.ts @@ -94,12 +94,9 @@ UTILS.nextFrame = function(cb: () => void) { requestAnimationFrame(() => requestAnimationFrame(cb)); }; -UTILS.transitionCreate = function(elm: HTMLElement, name: string) { +UTILS.transitionInsert = function(elm: HTMLElement, name: string) { elm.classList.add(name + "-enter"); elm.classList.add(name + "-enter-active"); -}; - -UTILS.transitionInsert = function(elm: HTMLElement, name: string) { const finalize = () => { elm.classList.remove(name + "-enter-active"); elm.classList.remove(name + "-enter-to"); @@ -172,7 +169,6 @@ QWeb.addDirective({ atNodeCreation({ value, addNodeHook }) { let name = value; const hooks = { - create: `this.utils.transitionCreate(n.elm, '${name}');`, insert: `this.utils.transitionInsert(vn.elm, '${name}');`, remove: `this.utils.transitionRemove(vn.elm, '${name}', rm);` }; diff --git a/tests/__snapshots__/qweb.test.ts.snap b/tests/__snapshots__/qweb.test.ts.snap index fca14bf1..5b1ca054 100644 --- a/tests/__snapshots__/qweb.test.ts.snap +++ b/tests/__snapshots__/qweb.test.ts.snap @@ -7,9 +7,6 @@ exports[`animations t-transition with no delay/duration 1`] = ` let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); p1.hook = { - create: (_, n) => { - this.utils.transitionCreate(n.elm, 'jupiler'); - }, insert: vn => { this.utils.transitionInsert(vn.elm, 'jupiler'); }, @@ -29,9 +26,6 @@ exports[`animations t-transition, on a simple node (insert) 1`] = ` let c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); p1.hook = { - create: (_, n) => { - this.utils.transitionCreate(n.elm, 'chimay'); - }, insert: vn => { this.utils.transitionInsert(vn.elm, 'chimay'); },