Made default value shown in inline box, removed non required line
This commit is contained in:
parent
2ff813d339
commit
95a01d5638
@ -14,7 +14,6 @@ module.exports = function(newDiagram){
|
||||
accepted = confirm("This document contains Javascript. You should only allow this document to be opened if you trust the source.");
|
||||
}
|
||||
if(accepted){
|
||||
if(newDiagramObject.state.filter((block)=>(block.type == "custom")).length) customCode = true;
|
||||
Object.assign(diagram, newDiagramObject);
|
||||
$("#workspace>*").remove();
|
||||
for(var block of diagram.state){
|
||||
|
@ -20,7 +20,7 @@ function blockPositionChange(event){ //fired when a block is moved or added
|
||||
}
|
||||
}
|
||||
|
||||
$("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){
|
||||
$("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){ //add new block
|
||||
var newBlock = {
|
||||
id: uuid.v4(),
|
||||
position: {
|
||||
@ -38,7 +38,7 @@ $("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){
|
||||
.reduce((inputs, input)=>{ //turn this into an object
|
||||
inputs[input] = {
|
||||
joined: "",
|
||||
value: ""
|
||||
value: blocks[$(this).parent().data("type")].inputs[input].default || "" //use default value if present
|
||||
};
|
||||
return inputs;
|
||||
}, {}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user