From e03a4a9e30c12bc003735622cfb00b9f70d68e69 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 18 Jul 2016 00:54:34 -0700 Subject: [PATCH] Fix creation of uneditable blocks. Issue #324. --- core/field.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/field.js b/core/field.js index 00a717c27..9060e8532 100644 --- a/core/field.js +++ b/core/field.js @@ -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;