mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Review updates
This commit is contained in:
@@ -55,6 +55,7 @@ goog.requireType('Blockly.WorkspaceSvg');
|
||||
* the individual field's documentation for a list of properties this
|
||||
* parameter supports.
|
||||
* @constructor
|
||||
* @abstract
|
||||
* @implements {Blockly.IASTNodeLocationSvg}
|
||||
* @implements {Blockly.IASTNodeLocationWithBlock}
|
||||
* @implements {Blockly.IKeyboardAccessible}
|
||||
@@ -154,14 +155,6 @@ Blockly.Field = function(value, opt_validator, opt_config) {
|
||||
opt_validator && this.setValidator(opt_validator);
|
||||
};
|
||||
|
||||
/**
|
||||
* Construct a Field from a JSON arg object.
|
||||
* @param {!Object} _options A JSON object with options.
|
||||
*/
|
||||
Blockly.Field.fromJson = function(_options) {
|
||||
throw Error("Field subclass doesn't define fromJson");
|
||||
};
|
||||
|
||||
/**
|
||||
* The default value for this field.
|
||||
* @type {*}
|
||||
|
||||
@@ -151,7 +151,7 @@ Blockly.FieldDropdown.ImageProperties;
|
||||
Blockly.FieldDropdown.fromJson = function(options) {
|
||||
// `this` might be a subclass of FieldDropdown if that class doesn't override
|
||||
// the static fromJson method.
|
||||
return new Blockly.FieldDropdown(options['options'], undefined, options);
|
||||
return new this(options['options'], undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -89,8 +89,8 @@ Blockly.FieldMultilineInput.prototype.configure_ = function(config) {
|
||||
*/
|
||||
Blockly.FieldMultilineInput.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
// `this` might be a subclass of FieldLabel if that class doesn't override
|
||||
// the static fromJson method.
|
||||
// `this` might be a subclass of FieldMultilineInput if that class doesn't
|
||||
// override the static fromJson method.
|
||||
return new this(text, undefined, options);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user