blockly下拉框支持任意内容
This commit is contained in:
parent
a3cefb6e63
commit
d1dc12208f
@ -720,6 +720,6 @@ HTML5魔塔交流群群号: `539113091`
|
|||||||
|
|
||||||
[@tocque](https://github.com/tocque) 鹿神:装备栏、动态创建图层等多项功能的编写者。同时也参与了多种辅助小工具的开发。
|
[@tocque](https://github.com/tocque) 鹿神:装备栏、动态创建图层等多项功能的编写者。同时也参与了多种辅助小工具的开发。
|
||||||
|
|
||||||
[@AutumnOrange51](https://github.com/AutumnOrange51) 秋橙:样板的QA(质量监管人员),提出了大量需求,同时也编写了全新的文档。
|
[@AutumnOrange](https://space.bilibili.com/399329257) 秋橙:样板的QA(质量监管人员),提出了大量需求,同时也编写了全新的文档。
|
||||||
|
|
||||||
以及H5魔塔交流群`539113091`,HTML5造塔技术交流群`959329661`的诸位魔塔爱好者们对本样板的大力支持!
|
以及H5魔塔交流群`539113091`,HTML5造塔技术交流群`959329661`的诸位魔塔爱好者们对本样板的大力支持!
|
||||||
|
|||||||
@ -1162,3 +1162,21 @@ Blockly.BlockSvg.prototype.generateContextMenu = function() {
|
|||||||
if (this.customContextMenu) this.customContextMenu(menuOptions);
|
if (this.customContextMenu) this.customContextMenu(menuOptions);
|
||||||
return menuOptions;
|
return menuOptions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Blockly.FieldDropdown.prototype.doClassValidation_ = function (opt_newValue) {
|
||||||
|
return opt_newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Blockly.FieldDropdown.prototype.doValueUpdate_ = function (newValue) {
|
||||||
|
Blockly.FieldDropdown.superClass_.doValueUpdate_.call(this, newValue);
|
||||||
|
var options = this.getOptions(true);
|
||||||
|
for (var i = 0, option; (option = options[i]); i++) {
|
||||||
|
if (option[1] == this.value_) {
|
||||||
|
this.selectedOption_ = option;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.selectedOption_[1] != this.value_) {
|
||||||
|
options.push([this.value_, this.value_]);
|
||||||
|
this.selectedOption_ = options[options.length - 1];
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue
Block a user