Getting Menu Items into the APP SCHEMA

This commit is contained in:
Luis Fernando Molina committed 2019-12-16 10:47:29 +01:00
1 parent 94829ecafb
commit 4c6720582f
4 files changed
+27 -10

No files matched your search

+7
View File
@@ -224,6 +224,13 @@ function newCanvas () {
}
}
if ((event.ctrlKey === true || event.metaKey === true) && event.altKey === true && event.shiftKey === true && event.keyCode === 122) { // Regenerates APP SCHEMA FILE
let text = JSON.stringify(APP_SCHEMA_ARRAY)
let fileName = 'AppSchema.json'
download(fileName, text)
return
}
if (event.altKey === true && event.code === 'ArrowUp') {
thisObject.cockpitSpace.toTop()
return
-10
View File
@@ -927,14 +927,4 @@ function newWorkspace () {
}
}
function download (filename, text) {
let element = document.createElement('a')
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
element.setAttribute('download', filename)
element.style.display = 'none'
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}
}
+10
View File
@@ -141,6 +141,16 @@ function newUiObject () {
function initialize (payload, menuItemsInitialValues) {
thisObject.payload = payload
let schemaNode = APP_SCHEMA_MAP.get(payload.node.type)
if (schemaNode === undefined) {
schemaNode = {
type: payload.node.type,
menuItems: menuItemsInitialValues
}
APP_SCHEMA_MAP.set(payload.node.type, schemaNode)
APP_SCHEMA_ARRAY.push(schemaNode)
}
/* Initialize the Menu */
thisObject.menu = newCircularMenu()
+10
View File
@@ -1,4 +1,14 @@
function download (filename, text) {
let element = document.createElement('a')
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text))
element.setAttribute('download', filename)
element.style.display = 'none'
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}
function transformThisPoint (point, container) {
/* We make the point relative to the current frame */