mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Added Field Value Tests (#2459)
* Added field value tests. * Fixed field image src param. * Fixed falsy values with label fields. * Fixed falsy values with text input fields. * Fixed some angle field tests. * Fixed other text input when editing tests. * Fixed colour tests. * Cleaned up some number and variable field tests. * Added angle field > 360 degrees tests. * Fixed variable validator tests. * Split setValue tests into sub-suites. * Fixed angle >360 tests * Changed var declarations to property declarations.
This commit is contained in:
@@ -32,7 +32,8 @@ goog.require('Blockly.utils');
|
||||
|
||||
/**
|
||||
* Class for a checkbox field.
|
||||
* @param {string} state The initial state of the field ('TRUE' or 'FALSE').
|
||||
* @param {string=} opt_state The initial state of the field ('TRUE' or
|
||||
* 'FALSE'), defaults to 'FALSE'.
|
||||
* @param {Function=} opt_validator A function that is executed when a new
|
||||
* option is selected. Its sole argument is the new checkbox state. If
|
||||
* it returns a value, this becomes the new checkbox state, unless the
|
||||
@@ -40,10 +41,10 @@ goog.require('Blockly.utils');
|
||||
* @extends {Blockly.Field}
|
||||
* @constructor
|
||||
*/
|
||||
Blockly.FieldCheckbox = function(state, opt_validator) {
|
||||
Blockly.FieldCheckbox = function(opt_state, opt_validator) {
|
||||
Blockly.FieldCheckbox.superClass_.constructor.call(this, '', opt_validator);
|
||||
// Set the initial state.
|
||||
this.setValue(state);
|
||||
this.setValue(opt_state);
|
||||
};
|
||||
goog.inherits(Blockly.FieldCheckbox, Blockly.Field);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user