mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
chore: fix more lint (#5676)
* chore: fix assorted lint * chore: clang-format * chore: clang-format
This commit is contained in:
@@ -80,16 +80,16 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
customContextMenu: function(options) {
|
||||
// Getter blocks have the option to create a setter block, and vice versa.
|
||||
if (!this.isInFlyout) {
|
||||
let opposite_type;
|
||||
let oppositeType;
|
||||
let contextMenuMsg;
|
||||
const id = this.getFieldValue('VAR');
|
||||
const variableModel = this.workspace.getVariableById(id);
|
||||
const varType = variableModel.type;
|
||||
if (this.type === 'variables_get_dynamic') {
|
||||
opposite_type = 'variables_set_dynamic';
|
||||
oppositeType = 'variables_set_dynamic';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_GET_CREATE_SET'];
|
||||
} else {
|
||||
opposite_type = 'variables_get_dynamic';
|
||||
oppositeType = 'variables_get_dynamic';
|
||||
contextMenuMsg = Blockly.Msg['VARIABLES_SET_CREATE_GET'];
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MI
|
||||
xmlField.setAttribute('variabletype', varType);
|
||||
xmlField.appendChild(Blockly.utils.xml.createTextNode(name));
|
||||
const xmlBlock = Blockly.utils.xml.createElement('block');
|
||||
xmlBlock.setAttribute('type', opposite_type);
|
||||
xmlBlock.setAttribute('type', oppositeType);
|
||||
xmlBlock.appendChild(xmlField);
|
||||
option.callback = Blockly.ContextMenu.callbackFactory(this, xmlBlock);
|
||||
options.push(option);
|
||||
|
||||
Reference in New Issue
Block a user