Fix creation of uneditable blocks. Issue #324.

This commit is contained in:
Neil Fraser
2016-07-18 00:54:34 -07:00
parent 5c2c4d8400
commit e03a4a9e30

View File

@@ -178,7 +178,7 @@ Blockly.Field.prototype.dispose = function() {
* Add or remove the UI indicating if this field is editable or not.
*/
Blockly.Field.prototype.updateEditable = function() {
if (!this.EDITABLE || !this.sourceBlock_) {
if (!this.EDITABLE || !this.fieldGroup_) {
return;
}
if (this.sourceBlock_.isEditable()) {
@@ -261,7 +261,7 @@ Blockly.Field.prototype.callValidator = function(text) {
}
var userValidator = this.getValidator();
if (userValidator) {
var userResult = userValidator(text);
var userResult = userValidator.call(this, text);
if (userResult === null) {
// User validator rejects value. Game over.
return null;