Tidy up
This commit is contained in:
parent
c111f02e70
commit
fb0866f0d9
|
@ -124,6 +124,7 @@
|
||||||
if (!message?.data?.type) {
|
if (!message?.data?.type) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.debug(`CLIENT: [${message.data.type}]`)
|
||||||
|
|
||||||
// Await the event handler
|
// Await the event handler
|
||||||
try {
|
try {
|
||||||
|
@ -139,20 +140,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBudibaseEvent = async event => {
|
const handleBudibaseEvent = async event => {
|
||||||
const { type, data } = event.data || event.detail
|
const { type, data } = event.data
|
||||||
if (!type) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (type === MessageTypes.READY) {
|
if (type === MessageTypes.READY) {
|
||||||
// Initialise the app when mounted
|
// Initialise the app when mounted
|
||||||
if ($store.clientFeatures.messagePassing) {
|
if (!loading) {
|
||||||
if (!loading) return
|
return
|
||||||
}
|
|
||||||
|
|
||||||
// Display preview immediately if the intelligent loading feature
|
|
||||||
// is not supported
|
|
||||||
if (!$store.clientFeatures.intelligentLoading) {
|
|
||||||
loading = false
|
|
||||||
}
|
}
|
||||||
refreshContent(json)
|
refreshContent(json)
|
||||||
} else if (type === MessageTypes.ERROR) {
|
} else if (type === MessageTypes.ERROR) {
|
||||||
|
|
|
@ -7,10 +7,12 @@
|
||||||
let gridStyles
|
let gridStyles
|
||||||
let id
|
let id
|
||||||
|
|
||||||
|
// Some memoisation of primitive types for performance
|
||||||
$: jsonStyles = JSON.stringify(gridStyles)
|
$: jsonStyles = JSON.stringify(gridStyles)
|
||||||
$: id = dragInfo?.id || id
|
$: id = dragInfo?.id || id
|
||||||
$: instance = componentStore.actions.getComponentInstance(id)
|
|
||||||
$: instance?.setEphemeralStyles({
|
// Set ephemeral grid styles on the dragged component
|
||||||
|
$: componentStore.actions.getComponentInstance(id)?.setEphemeralStyles({
|
||||||
...gridStyles,
|
...gridStyles,
|
||||||
...(gridStyles ? { "z-index": 999 } : null),
|
...(gridStyles ? { "z-index": 999 } : null),
|
||||||
})
|
})
|
||||||
|
@ -193,7 +195,6 @@
|
||||||
|
|
||||||
// Callback when drag stops (whether dropped or not)
|
// Callback when drag stops (whether dropped or not)
|
||||||
const stopDragging = async () => {
|
const stopDragging = async () => {
|
||||||
console.log("STOP")
|
|
||||||
// Save changes
|
// Save changes
|
||||||
if (gridStyles) {
|
if (gridStyles) {
|
||||||
await builderStore.actions.updateStyles(gridStyles, dragInfo.id)
|
await builderStore.actions.updateStyles(gridStyles, dragInfo.id)
|
||||||
|
|
Loading…
Reference in New Issue