From b36d4c8a76d78c85de58d54a62552bd059dffcb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 1 Mar 2021 16:58:01 +0100 Subject: [PATCH] fix not being able to remove transition --- packages/builder/src/builderStore/store/frontend.js | 4 ++-- packages/client/src/utils/transition.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index f195ea4d99..8877ccef69 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -488,10 +488,10 @@ export const getFrontendStore = () => { selected._styles = { normal: {}, hover: {}, active: {} } await store.actions.preview.saveSelected() }, - updateTransition: async (transition) => { + updateTransition: async transition => { const selected = get(selectedComponent) if (transition == null || transition === "") { - selected = "" + selected._transition = "" } else { selected._transition = transition } diff --git a/packages/client/src/utils/transition.js b/packages/client/src/utils/transition.js index aa0ae0f78b..db2fa6ad5f 100644 --- a/packages/client/src/utils/transition.js +++ b/packages/client/src/utils/transition.js @@ -1,4 +1,4 @@ -import { fade, blur, slide, fly } from 'svelte/transition' +import { fade, blur, slide, fly } from "svelte/transition" // Default options const transitions = new Map([ @@ -8,8 +8,8 @@ const transitions = new Map([ ["scale", { tn: slide, opt: {} }], ["fly", { tn: fly, opt: { y: 80 } }], ]) - -export default function transition(node, {type, options = {}}) { - const { tn, opt } = transitions.get(type) || {} - return tn ? tn(node, {...opt, ...options}) : fade(node, { duration: 0}) -} \ No newline at end of file + +export default function transition(node, { type, options = {} }) { + const { tn, opt } = transitions.get(type) || {} + return tn ? tn(node, { ...opt, ...options }) : fade(node, { duration: 0 }) +}