Revert click context
This commit is contained in:
parent
d2f9201bd0
commit
4bc2c7a28f
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
const { styleable, builderStore } = getContext("sdk")
|
const { styleable, builderStore } = getContext("sdk")
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
const containerClickableStore = getContext("containerClickable")
|
|
||||||
|
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let text = ""
|
export let text = ""
|
||||||
|
@ -19,10 +18,6 @@
|
||||||
|
|
||||||
let node
|
let node
|
||||||
|
|
||||||
containerClickableStore.subscribe(hasOnClick => {
|
|
||||||
disabled = hasOnClick
|
|
||||||
})
|
|
||||||
|
|
||||||
$: $component.editing && node?.focus()
|
$: $component.editing && node?.focus()
|
||||||
$: componentText = getComponentText(text, $builderStore, $component)
|
$: componentText = getComponentText(text, $builderStore, $component)
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext, setContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { writable } from "svelte/store"
|
|
||||||
|
|
||||||
const { styleable } = getContext("sdk")
|
const { styleable } = getContext("sdk")
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
|
||||||
const containerClickableStore = writable(false)
|
|
||||||
setContext("containerClickable", containerClickableStore)
|
|
||||||
|
|
||||||
export let direction
|
export let direction
|
||||||
export let hAlign
|
export let hAlign
|
||||||
export let vAlign
|
export let vAlign
|
||||||
|
@ -28,7 +24,6 @@
|
||||||
sizeClass,
|
sizeClass,
|
||||||
gapClass,
|
gapClass,
|
||||||
].join(" ")
|
].join(" ")
|
||||||
$: containerClickableStore.set(!!onClick)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -333,10 +333,6 @@ const confirmTextMap = {
|
||||||
* A handler returning `false` is a flag to stop execution of handlers
|
* A handler returning `false` is a flag to stop execution of handlers
|
||||||
*/
|
*/
|
||||||
export const enrichButtonActions = (actions, context) => {
|
export const enrichButtonActions = (actions, context) => {
|
||||||
if (actions && actions.length === 0) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent button actions in the builder preview
|
// Prevent button actions in the builder preview
|
||||||
if (!actions || get(builderStore).inBuilder) {
|
if (!actions || get(builderStore).inBuilder) {
|
||||||
return () => {}
|
return () => {}
|
||||||
|
|
Loading…
Reference in New Issue