mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
Clean up fields by passing the right type in fromJson (#3095)
This commit is contained in:
@@ -97,7 +97,7 @@ Blockly.utils.object.inherits(Blockly.FieldAngle, Blockly.FieldTextInput);
|
||||
* @nocollapse
|
||||
*/
|
||||
Blockly.FieldAngle.fromJson = function(options) {
|
||||
return new Blockly.FieldAngle(options['angle'], null, options);
|
||||
return new Blockly.FieldAngle(options['angle'], undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,7 +77,7 @@ Blockly.utils.object.inherits(Blockly.FieldCheckbox, Blockly.Field);
|
||||
* @nocollapse
|
||||
*/
|
||||
Blockly.FieldCheckbox.fromJson = function(options) {
|
||||
return new Blockly.FieldCheckbox(options['checked'], null, options);
|
||||
return new Blockly.FieldCheckbox(options['checked'], undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,7 +79,7 @@ Blockly.utils.object.inherits(Blockly.FieldColour, Blockly.Field);
|
||||
* @nocollapse
|
||||
*/
|
||||
Blockly.FieldColour.fromJson = function(options) {
|
||||
return new Blockly.FieldColour(options['colour'], null, options);
|
||||
return new Blockly.FieldColour(options['colour'], undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -133,7 +133,7 @@ Blockly.utils.object.inherits(Blockly.FieldImage, Blockly.Field);
|
||||
Blockly.FieldImage.fromJson = function(options) {
|
||||
return new Blockly.FieldImage(
|
||||
options['src'], options['width'], options['height'],
|
||||
null, null, null, options);
|
||||
undefined, undefined, undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -84,7 +84,7 @@ Blockly.utils.object.inherits(Blockly.FieldLabel, Blockly.Field);
|
||||
*/
|
||||
Blockly.FieldLabel.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
return new Blockly.FieldLabel(text, null, options);
|
||||
return new Blockly.FieldLabel(text, undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ Blockly.utils.object.inherits(Blockly.FieldLabelSerializable,
|
||||
*/
|
||||
Blockly.FieldLabelSerializable.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
return new Blockly.FieldLabelSerializable(text, null, options);
|
||||
return new Blockly.FieldLabelSerializable(text, undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,7 +98,7 @@ Blockly.utils.object.inherits(Blockly.FieldNumber, Blockly.FieldTextInput);
|
||||
*/
|
||||
Blockly.FieldNumber.fromJson = function(options) {
|
||||
return new Blockly.FieldNumber(options['value'],
|
||||
null, null, null, null, options);
|
||||
undefined, undefined, undefined, undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -80,7 +80,7 @@ Blockly.utils.object.inherits(Blockly.FieldTextInput, Blockly.Field);
|
||||
*/
|
||||
Blockly.FieldTextInput.fromJson = function(options) {
|
||||
var text = Blockly.utils.replaceMessageReferences(options['text']);
|
||||
return new Blockly.FieldTextInput(text, null, options);
|
||||
return new Blockly.FieldTextInput(text, undefined, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user