Skip to content

Commit

Permalink
Update data_category.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RedMan13 authored Nov 25, 2023
1 parent e99f773 commit 1be79cf
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions core/data_category.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,20 @@ Blockly.VariableCategory = function(workspace) {
var xmlList = [];

Blockly.VariableCategory.addCreateButton(xmlList, workspace, 'VARIABLE');

if (variableModelList.length > 0) {
if (globalVars > 0) {
Blockly.VariableCategory.addLabel(xmlList, "Public Variables")
for (var i = 0; i < globalVars.length; i++) {
Blockly.VariableCategory.addDataVariable(xmlList, globalVars[i]);
}
}
if (localVars > 0) {
Blockly.VariableCategory.addLabel(xmlList, "Private Variables")
for (var i = 0; i < localVars.length; i++) {
Blockly.VariableCategory.addDataVariable(xmlList, localVars[i]);
}
}

if (variableModelList.length > 0) {
xmlList[xmlList.length - 1].setAttribute('gap', 24);
var firstVariable = variableModelList[0];

Expand All @@ -79,16 +83,20 @@ Blockly.VariableCategory.ListCategory = function(workspace) {
var xmlList = [];

Blockly.VariableCategory.addCreateButton(xmlList, workspace, 'LIST');

if (variableModelList.length > 0) {
if (globalVars > 0) {
Blockly.VariableCategory.addLabel(xmlList, "Public Lists")
for (var i = 0; i < globalVars.length; i++) {
Blockly.VariableCategory.addDataList(xmlList, globalVars[i]);
}
}
if (lovalVars > 0) {
Blockly.VariableCategory.addLabel(xmlList, "Private Lists")
for (var i = 0; i < localVars.length; i++) {
Blockly.VariableCategory.addDataList(xmlList, localVars[i]);
}
}

if (variableModelList.length > 0) {
xmlList[xmlList.length - 1].setAttribute('gap', 24);
var firstList = variableModelList[0];

Expand Down

0 comments on commit 1be79cf

Please sign in to comment.