mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Cleaned up BlockBase and CommentBase toJson and fromJson calls.
This commit is contained in:
@@ -73,7 +73,7 @@ Blockly.Events.BlockBase.prototype.toJson = function() {
|
||||
* @param {!Object} json JSON representation.
|
||||
*/
|
||||
Blockly.Events.BlockBase.prototype.fromJson = function(json) {
|
||||
Blockly.Events.BlockBase.superClass_.toJson.call(this);
|
||||
Blockly.Events.BlockBase.superClass_.fromJson.call(this, json);
|
||||
this.blockId = json['blockId'];
|
||||
};
|
||||
|
||||
|
||||
@@ -78,12 +78,7 @@ goog.inherits(Blockly.Events.CommentBase, Blockly.Events.Abstract);
|
||||
* @return {!Object} JSON representation.
|
||||
*/
|
||||
Blockly.Events.CommentBase.prototype.toJson = function() {
|
||||
var json = {
|
||||
'type': this.type
|
||||
};
|
||||
if (this.group) {
|
||||
json['group'] = this.group;
|
||||
}
|
||||
var json = Blockly.Events.CommentBase.superClass_.toJson.call(this);
|
||||
if (this.commentId) {
|
||||
json['commentId'] = this.commentId;
|
||||
}
|
||||
@@ -95,8 +90,8 @@ Blockly.Events.CommentBase.prototype.toJson = function() {
|
||||
* @param {!Object} json JSON representation.
|
||||
*/
|
||||
Blockly.Events.CommentBase.prototype.fromJson = function(json) {
|
||||
Blockly.Events.COmmentBase.superClass_.fromJson.call(this, json);
|
||||
this.commentId = json['commentId'];
|
||||
this.group = json['group'];
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user