mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Add block name as JSON id.
This commit is contained in:
@@ -258,10 +258,13 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() {
|
||||
// Save the edit (if it validates).
|
||||
var text = htmlInput.value;
|
||||
if (thisField.sourceBlock_ && thisField.changeHandler_) {
|
||||
text = thisField.changeHandler_(text);
|
||||
if (text === null) {
|
||||
var text1 = thisField.changeHandler_(text);
|
||||
if (text1 === null) {
|
||||
// Invalid edit.
|
||||
text = htmlInput.defaultValue;
|
||||
} else if (text1 !== undefined) {
|
||||
// Change handler has changed the text.
|
||||
text = text1;
|
||||
}
|
||||
}
|
||||
thisField.setText(text);
|
||||
|
||||
Reference in New Issue
Block a user