Skip to content

Commit eb839fc

Browse files
authored
fix: show the name of the list in the list getter block context menu (#132)
1 parent ff4b115 commit eb839fc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

blocks_vertical/data.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ const CUSTOM_CONTEXT_MENU_GET_LIST_MIXIN = {
596596
if (this.isCollapsed()) {
597597
return;
598598
}
599-
var currentVarName = this.getField(fieldName).text_;
599+
var currentVarName = this.getField(fieldName).getVariable().getName();
600600
if (!this.isInFlyout) {
601601
var variablesList = this.workspace.getVariablesOfType(
602602
Constants.LIST_VARIABLE_TYPE
@@ -683,8 +683,7 @@ const RENAME_OPTION_CALLBACK_FACTORY = function (block, fieldName) {
683683
*/
684684
const DELETE_OPTION_CALLBACK_FACTORY = function (block, fieldName) {
685685
return function () {
686-
var workspace = block.workspace;
687-
var variable = block.getField(fieldName).getVariable();
688-
workspace.deleteVariableById(variable.getId());
686+
const variable = block.getField(fieldName).getVariable();
687+
Blockly.Variables.deleteVariable(variable.getWorkspace(), variable, block);
689688
};
690689
};

0 commit comments

Comments
 (0)