Refactorings for page and settings props
This commit is contained in:
parent
b136eaea17
commit
dd0eec0592
|
@ -295,6 +295,7 @@ const setCurrentPage = store => pageName => {
|
|||
|
||||
state.currentFrontEndType = "page"
|
||||
state.currentPageName = pageName
|
||||
state.currentView = "detail"
|
||||
state.screens = Array.isArray(current_screens)
|
||||
? current_screens
|
||||
: Object.values(current_screens)
|
||||
|
@ -455,6 +456,7 @@ const setScreenType = store => type => {
|
|||
|
||||
state.currentComponentInfo = pageOrScreen ? pageOrScreen.props : null
|
||||
state.currentPreviewItem = pageOrScreen
|
||||
state.currentView = "detail"
|
||||
return state
|
||||
})
|
||||
}
|
||||
|
|
|
@ -58,25 +58,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
let componentInstance = {}
|
||||
$: {
|
||||
if(($store.currentFrontEndType === "screen" || $store.currentFrontEndType === "page") && $store.currentView !== "component") {
|
||||
componentInstance = {...$store.currentPreviewItem, ...$store.currentComponentInfo}
|
||||
}else {
|
||||
componentInstance = $store.currentComponentInfo
|
||||
}
|
||||
}
|
||||
$: componentInstance = $store.currentView !== "component" ? {...$store.currentPreviewItem, ...$store.currentComponentInfo} : $store.currentComponentInfo
|
||||
|
||||
const onStyleChanged = store.setComponentStyle
|
||||
|
||||
function onPropChanged(key, value) {
|
||||
if($store.currentFrontEndType === "page") {
|
||||
if($store.currentView !== "component") {
|
||||
store.editPageOrScreen(key, value)
|
||||
}else if($store.currentFrontEndType === "screen" && $store.currentView !== "component") {
|
||||
store.editPageOrScreen(key, value)
|
||||
}else {
|
||||
store.setComponentProp(key, value)
|
||||
return
|
||||
}
|
||||
store.setComponentProp(key, value)
|
||||
}
|
||||
|
||||
function walkProps(component, action) {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
newScreenPicker.show()
|
||||
}
|
||||
|
||||
$: console.log("STORE SCREENS", $store.screens)
|
||||
let newScreenPicker
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue