Skip to content
Snippets Groups Projects
Commit 2243ada1 authored by baigner's avatar baigner
Browse files

Started on enabling right click options for variables and functions in list...

Started on enabling right click options for variables and functions in list view. Does not work yet!


Former-commit-id: 98cf3e5bb120fa9783a2fc675fc059617946aabd
parent ee1b3c4d
No related branches found
No related tags found
No related merge requests found
Pipeline #192828 canceled
......@@ -19399,15 +19399,39 @@
else
{
bootbox.hideAll();
var schema = currentGraph.variableSchemes[varCategories[0].description];
var treeData = (JSON.parse(JSON.stringify(schema)));
var graphElements = JSON.parse(result)
var treeData = (JSON.parse(JSON.stringify(currentGraph.variableSchemes[varCategories[0].description])));
var firstEl = treeData[0].xPath.split("/")[1]
var graphElements = JSON.parse(result)
var message = "";
if (result.includes("/"+treeData.name))
var variables = [];
var functions = [];
if (result.includes("/"+firstEl))
{
bootbox.prompt(
var pipeData = [];
//There are variables in the result
graphElements.forEach(function(graphElement)
{
if (graphElement.includes("/"+firstEl))
{
pipeData += ","+graphElement;
}
else
{
functions.push({name:graphElement,type:"function"})
}
})
variables = JSON.parse(JSON.stringify(treeData))
prune_tree(pipeData,variables)
variables.forEach(function(variable)
{
variable.name = variable.xPath
})
bootbox.prompt(
{
title: "The graph elements you requested contain variables. How do you want them displayed?",
inputType: 'checkbox',
......@@ -19417,30 +19441,9 @@
if (result)
{
var message1 = "", message2 = "";
var array = ""
var list = [];
graphElements.forEach(function(graphElement)
{
if (graphElement.includes("/"+treeData.name))
{
if (result.includes("Tree View"))
{
if (array == ""){array += graphElement}
else{array += "," + graphElement}
}
if (result.includes("List"))
{
list.push({name:graphElement,type:"variable"});
}
}
else
{
list.push({name:graphElement,type:"function"});
}
})
if(array!="")
var array
bootbox.hideAll();
if(result.includes("Tree View"))
{
var headLine = "Tree Layout for category:\" " + category + "\", subcategory:\" " + sub_category + "\"";
var d3_body = d3.select("body");
......@@ -19465,12 +19468,19 @@
var treeLayout = treeLayoutSVG.append("g").attr("class","treeLayout");
maketreeLayout(array, treeLayout, treeLayoutSVG, treeLayoutdiv, headLine, varCategories[0].description);
}
show_bootBox_listMessage(list);
if (result.includes("List"))
{
var list = []
list = functions.concat(variables);
console.log(functions)
console.log(variables)
console.log(list)
show_bootBox_listMessage(list);
}
}
}
})
}
}
else
{
var list = [];
......@@ -19512,7 +19522,9 @@
})
if (listElement.type=="variable")
{
td.on("mousedown",function(){bootbox.alert("I'm a variable!")})
td.on("mousedown",function(){
console.log(listElement)
})
}
else if (listElement.type=="function")
{
......@@ -22446,7 +22458,7 @@
}
startXDSM(data,graphID);
 
////aigner: Unused funcktions --> Could be helpful at some point
////aigner: Unused functions --> Could be helpful at some point
////aigner: clone function, so that original object is not overwritten but deep copied
// function clone(obj) {
// if (null == obj || "object" != typeof obj) return obj;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment