Don't output blockId if not set (e.g., toolbox category event). (#443)

This commit is contained in:
Andrew n marshall
2016-06-22 13:11:19 -07:00
committed by Neil Fraser
parent 91b10cae2f
commit 425513b729

View File

@@ -303,8 +303,10 @@ Blockly.Events.Abstract = function(block) {
Blockly.Events.Abstract.prototype.toJson = function() {
var json = {
'type': this.type,
'blockId': this.blockId
};
if (this.blockId) {
json['blockId'] = this.blockId;
}
if (this.group) {
json['group'] = this.group;
}