Skip to content

Commit

Permalink
single quote syntax, and correct null filename check
Browse files Browse the repository at this point in the history
  • Loading branch information
stevoleeto committed Jul 25, 2015
1 parent c5e7163 commit fe45113
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions blockly/apps/blocklyduino/blockly_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@ function restore_blocks() {
function save() {
var xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
var data = Blockly.Xml.domToText(xml);
var fileName = window.prompt("What would you like to name your file?", "BlocklyDuino");
fileName = fileName + ".xml";
var fileName = window.prompt('What would you like to name your file?', 'BlocklyDuino');
// Store data in blob.
// var builder = new BlobBuilder();
// builder.append(data);
// saveAs(builder.getBlob('text/plain;charset=utf-8'), 'blockduino.xml');
if(fileName != "null"){
if(fileName){
var blob = new Blob([data], {type: 'text/xml'});
saveAs(blob, fileName);
saveAs(blob, fileName + ".xml");
}
}

Expand Down

0 comments on commit fe45113

Please sign in to comment.