Fixed issue with menu crashing without a popup position when starting with dollarsign $

This commit is contained in:
frikky
2022-06-15 00:04:23 +02:00
parent 4d146e53e2
commit 638f67004a
2 changed files with 18 additions and 3 deletions
+17 -2
View File
@@ -1064,7 +1064,7 @@ const ParsedAction = (props) => {
*/ */
} }
console.log("APP: ", selectedApp) //console.log("APP: ", selectedApp)
// FIXME: Issue #40 - selectedActionParameters not reset // FIXME: Issue #40 - selectedActionParameters not reset
if ( if (
@@ -1994,6 +1994,21 @@ const ParsedAction = (props) => {
const coverColor = "#82ccc3" const coverColor = "#82ccc3"
//menuPosition.left -= 50 //menuPosition.left -= 50
//menuPosition.top -= 250 //menuPosition.top -= 250
console.log("POS: ", menuPosition1)
var menuPosition1 = menuPosition
if (menuPosition1 === null) {
menuPosition1 = {
"left": 0,
"top": 0,
}
} else if (menuPosition1.top === null || menuPosition1.top === undefined) {
menuPosition1.top = 0
} else if (menuPosition1.left === null || menuPosition1.left === undefined) {
menuPosition1.left = 0
}
console.log("POS1: ", menuPosition1)
return parsedPaths.length > 0 ? ( return parsedPaths.length > 0 ? (
<NestedMenuItem <NestedMenuItem
key={innerdata.name} key={innerdata.name}
@@ -2016,7 +2031,7 @@ const ParsedAction = (props) => {
handleItemClick([innerdata]); handleItemClick([innerdata]);
}} }}
> >
<Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition.top-200, left: menuPosition.left-455, padding: "10px 0px 10px 10px", backgroundColor: theme.palette.inputColor, overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}> <Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-455, padding: "10px 0px 10px 10px", backgroundColor: theme.palette.inputColor, overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
<MenuItem <MenuItem
key={innerdata.name} key={innerdata.name}
style={{ style={{
+1 -1
View File
@@ -3197,7 +3197,7 @@ const AngularWorkflow = (defaultprops) => {
if (nodedata.finished === false || (nodedata.id !== undefined && nodedata.is_valid === undefined) if (nodedata.finished === false || (nodedata.id !== undefined && nodedata.is_valid === undefined)
) { ) {
//if (nodedata.app_id === undefined) { //if (nodedata.app_id === undefined) {
console.log("Returning because node is not valid: ", nodedata) //console.log("Returning because node is not valid: ", nodedata)
return; return;
} }