diff --git a/core/field_textinput.js b/core/field_textinput.js index 089d62b8f..2e6c438e5 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -88,14 +88,6 @@ Blockly.FieldTextInput.prototype.SERIALIZABLE = true; */ Blockly.FieldTextInput.FONTSIZE = 11; -/** - * The HTML input element for the user to type, or null if no FieldTextInput - * editor is currently open. - * @type {HTMLInputElement} - * @protected - */ -Blockly.FieldTextInput.htmlInput_ = null; - /** * Mouse cursor style when over the hotspot that initiates the editor. */ diff --git a/tests/mocha/field_angle_test.js b/tests/mocha/field_angle_test.js index 7453c0a81..9a8252834 100644 --- a/tests/mocha/field_angle_test.js +++ b/tests/mocha/field_angle_test.js @@ -201,13 +201,13 @@ suite ('Angle Fields', function() { suite('Validators', function() { setup(function() { this.angleField = new Blockly.FieldAngle(1); - Blockly.FieldTextInput.htmlInput_ = Object.create(null); - Blockly.FieldTextInput.htmlInput_.oldValue_ = '1'; - Blockly.FieldTextInput.htmlInput_.untypedDefaultValue_ = 1; + this.angleField.htmlInput_ = Object.create(null); + this.angleField.htmlInput_.oldValue_ = '1'; + this.angleField.htmlInput_.untypedDefaultValue_ = 1; }); teardown(function() { this.angleField.setValidator(null); - Blockly.FieldTextInput.htmlInput_ = null; + this.angleField.htmlInput_ = null; }); suite('Null Validator', function() { setup(function() { @@ -217,7 +217,7 @@ suite ('Angle Fields', function() { }); test('When Editing', function() { this.angleField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '2'; + this.angleField.htmlInput_.value = '2'; this.angleField.onHtmlInputChange_(null); assertValue(this.angleField, 1, '2'); this.angleField.isBeingEdited_ = false; @@ -235,7 +235,7 @@ suite ('Angle Fields', function() { }); test('When Editing', function() { this.angleField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '25'; + this.angleField.htmlInput_.value = '25'; this.angleField.onHtmlInputChange_(null); assertValue(this.angleField, 30, '25'); this.angleField.isBeingEdited_ = false; @@ -251,7 +251,7 @@ suite ('Angle Fields', function() { }); test('When Editing', function() { this.angleField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '2'; + this.angleField.htmlInput_.value = '2'; this.angleField.onHtmlInputChange_(null); assertValue(this.angleField, 2); this.angleField.isBeingEdited_ = false; diff --git a/tests/mocha/field_number_test.js b/tests/mocha/field_number_test.js index 5485c2d94..4915c8b7f 100644 --- a/tests/mocha/field_number_test.js +++ b/tests/mocha/field_number_test.js @@ -298,13 +298,13 @@ suite ('Number Fields', function() { suite('Validators', function() { setup(function() { this.numberField = new Blockly.FieldNumber(1); - Blockly.FieldTextInput.htmlInput_ = Object.create(null); - Blockly.FieldTextInput.htmlInput_.oldValue_ = '1'; - Blockly.FieldTextInput.htmlInput_.untypedDefaultValue_ = 1; + this.numberField.htmlInput_ = Object.create(null); + this.numberField.htmlInput_.oldValue_ = '1'; + this.numberField.htmlInput_.untypedDefaultValue_ = 1; }); teardown(function() { this.numberField.setValidator(null); - Blockly.FieldTextInput.htmlInput_ = null; + this.numberField.htmlInput_ = null; }); suite('Null Validator', function() { setup(function() { @@ -314,7 +314,7 @@ suite ('Number Fields', function() { }); test('When Editing', function() { this.numberField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '2'; + this.numberField.htmlInput_.value = '2'; this.numberField.onHtmlInputChange_(null); assertValue(this.numberField, 1, '2'); this.numberField.isBeingEdited_ = false; @@ -332,7 +332,7 @@ suite ('Number Fields', function() { }); test('When Editing', function() { this.numberField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '25'; + this.numberField.htmlInput_.value = '25'; this.numberField.onHtmlInputChange_(null); assertValue(this.numberField, 26, '25'); this.numberField.isBeingEdited_ = false; @@ -348,7 +348,7 @@ suite ('Number Fields', function() { }); test('When Editing', function() { this.numberField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = '2'; + this.numberField.htmlInput_.value = '2'; this.numberField.onHtmlInputChange_(null); assertValue(this.numberField, 2); this.numberField.isBeingEdited_ = false; diff --git a/tests/mocha/field_textinput_test.js b/tests/mocha/field_textinput_test.js index 30ed5b688..9b4e943be 100644 --- a/tests/mocha/field_textinput_test.js +++ b/tests/mocha/field_textinput_test.js @@ -169,9 +169,9 @@ suite ('Text Input Fields', function() { suite('Validators', function() { setup(function() { this.textInputField = new Blockly.FieldTextInput('value'); - Blockly.FieldTextInput.htmlInput_ = Object.create(null); - Blockly.FieldTextInput.htmlInput_.oldValue_ = 'value'; - Blockly.FieldTextInput.htmlInput_.untypedDefaultValue_ = 'value'; + this.textInputField.htmlInput_ = Object.create(null); + this.textInputField.htmlInput_.oldValue_ = 'value'; + this.textInputField.htmlInput_.untypedDefaultValue_ = 'value'; }); teardown(function() { this.textInputField.setValidator(null); @@ -185,7 +185,7 @@ suite ('Text Input Fields', function() { }); test('When Editing', function() { this.textInputField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = 'newValue'; + this.textInputField.htmlInput_.value = 'newValue'; this.textInputField.onHtmlInputChange_(null); assertValue(this.textInputField, 'value', 'newValue'); this.textInputField.isBeingEdited_ = false; @@ -203,7 +203,7 @@ suite ('Text Input Fields', function() { }); test('When Editing', function() { this.textInputField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = 'bbbaaa'; + this.textInputField.htmlInput_.value = 'bbbaaa'; this.textInputField.onHtmlInputChange_(null); assertValue(this.textInputField, 'bbb', 'bbbaaa'); this.textInputField.isBeingEdited_ = false; @@ -219,7 +219,7 @@ suite ('Text Input Fields', function() { }); test('When Editing', function() { this.textInputField.isBeingEdited_ = true; - Blockly.FieldTextInput.htmlInput_.value = 'newValue'; + this.textInputField.htmlInput_.value = 'newValue'; this.textInputField.onHtmlInputChange_(null); assertValue(this.textInputField, 'newValue'); this.textInputField.isBeingEdited_ = false;