Blockly.Blocks['lists_create_with'] = {
/**
* Block for creating a list with any number of elements of any type.
* @this {Blockly.Block}
*/
init: function() {
this.setHelpUrl(Blockly.Msg['LISTS_CREATE_WITH_HELPURL']);
this.setStyle('list_blocks');
this.itemCount_ = 3;
this.updateShape_();
this.setOutput(true, 'Array');
// This line is added.
this.setInputsInline(true);
this.setMutator(new Blockly.Mutator(['lists_create_with_item']));
this.setTooltip(Blockly.Msg['LISTS_CREATE_WITH_TOOLTIP']);
},
// etc
}
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/a71b3f1b-e4ce-4d37-af6d-1083ab904b41%40googlegroups.com.


![]()
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/d46e8d1a-7714-47fd-b027-02e0f6dffa59%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/d46e8d1a-7714-47fd-b027-02e0f6dffa59%40googlegroups.com.
is it possible to disable external inputs on menu of that list item block
var defaultGen = Blockly.BlockSvg.prototype.generateContextMenu;
Blockly.BlockSvg.prototype.generateContextMenu = function() {
var options = defaultGen.call(this);
console.log(options);
for (var i = 0, option; option = options[i]; i++) {
// Remove any option that includes the word "Inputs"
if (option.text.indexOf('Inputs') != -1) {
options.splice(i, 1);
break;
}
}
console.log(options);
return options;
} customContextMenu: function(options) {
console.log(options);
for (var i = 0, option; (option = options[i]); i++) {
// Remove any option that includes the word "Inputs"
if (option.text.indexOf('Inputs') != -1) {
options.splice(i, 1);
break;
}
}
console.log(options);
return options;
},The problem is that context menu items don't have a language-neutral ID, so you have to remove it based on the human-readable text. That means that removing it only works in English :/
Is this something that's already under discussion/being evaluated/getting fixed?


--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/c74273d2-42d9-45d6-a934-31095c2fe647%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/34800f5e-b9cb-40b1-9171-ee863785eed9%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blo...@googlegroups.com.