Skip to content

Develop fix workspace svg #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions core/workspace_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,11 +1038,17 @@ Blockly.WorkspaceSvg.prototype.deleteVariableById = function(id) {
* variable immediately.
* TODO: #468
* @param {string} name The new variable's name.
* @param {string=} opt_type The type of the variable like 'int' or 'string'.
* Does not need to be unique. Field_variable can filter variables based on
* their type. This will default to '' which is a specific type.
* @param {string=} opt_id The unique id of the variable. This will default to
* a UUID.
* @return {?Blockly.VariableModel} The newly created variable.
* @package
*/
Blockly.WorkspaceSvg.prototype.createVariable = function(name) {
var newVar = Blockly.WorkspaceSvg.superClass_.createVariable.call(this, name);
Blockly.WorkspaceSvg.prototype.createVariable = function(name, opt_type, opt_id) {
var newVar = Blockly.WorkspaceSvg.superClass_.createVariable.call(this, name,
opt_type, opt_id);
this.refreshToolboxSelection_();
return newVar;
};
Expand Down