Fixed bug on updating flags for custom categories, adjusted starter code (#615)

This commit is contained in:
Emma Dauterman
2016-08-31 10:50:01 -07:00
committed by picklesrus
parent d6e71ffe38
commit 8d89e62bc8
2 changed files with 12 additions and 8 deletions

View File

@@ -166,18 +166,22 @@ WorkspaceFactoryGenerator.prototype.generateInjectString = function() {
var attributes = addAttributes(this.model.options, '\t');
if (!this.model.options['readOnly']) {
attributes = '\ttoolbox : toolbox, /* TODO: Change toolbox XML ID if ' +
'necessary. Can export toolbox XML from Workspace Factory. */\n' +
attributes = '\ttoolbox : toolbox, \n' +
attributes;
}
var finalStr = 'var options = { \n' + attributes + '};';
var finalStr = '/* TODO: Change toolbox XML ID if necessary. Can export ' +
'toolbox XML from Workspace Factory. */\n' +
'var toolbox = document.getElementById("toolbox");\n\n';
finalStr += 'var options = { \n' + attributes + '};';
finalStr += '\n\n/* Inject your workspace */ \nvar workspace = Blockly.' +
'inject(/* TODO: Add ID of div to inject Blockly into */, options);';
finalStr += '\n\n/* Load Workspace Blocks from XML to workspace. ' +
'Remove if no blocks to load */' +
'\nBlockly.Xml.domToWorkspace(workspace, workspaceBlocks/*' +
' TODO: Change workspace blocks XML ID if necessary. Can export' +
' workspace blocks XML from Workspace Factory. */);';
'Remove all code below if no blocks to load */\n\n' +
'/* TODO: Change workspace blocks XML ID if necessary. Can export' +
' workspace blocks XML from Workspace Factory. */\n' +
'var workspaceBlocks = document.getElementById("workspaceBlocks"); \n\n' +
'/* Load blocks to workspace. */\n' +
'Blockly.Xml.domToWorkspace(workspace, workspaceBlocks);';
return finalStr;
}

View File

@@ -94,7 +94,7 @@ WorkspaceFactoryModel.prototype.hasVariables = function() {
* false otherwise.
*/
WorkspaceFactoryModel.prototype.hasProcedures = function() {
return this.hasFunctionCategory;
return this.hasProcedureCategory;
};
/**