Bug 1052028 - Remove 'Node' from displayed node names in web audio editor. r=vp

This commit is contained in:
Jordan Santell 2014-08-13 10:55:00 -04:00
parent 02337431c7
commit 2ab7a10626

View File

@ -156,7 +156,11 @@ let WebAudioGraphView = {
AudioNodes.forEach(node => {
// Add node to graph
graph.addNode(node.id, { label: node.type, id: node.id });
graph.addNode(node.id, {
type: node.type, // Just for storing type data
label: node.type.replace(/Node$/, ""), // Displayed in SVG node
id: node.id // Identification
});
// Add all of the connections from this node to the edge array to be added
// after all the nodes are added, otherwise edges will attempted to be created
@ -177,7 +181,7 @@ let WebAudioGraphView = {
let svgNodes = oldDrawNodes(graph, root);
svgNodes.attr("class", (n) => {
let node = graph.node(n);
return "audionode type-" + node.label;
return "audionode type-" + node.type;
});
svgNodes.attr("data-id", (n) => {
let node = graph.node(n);