Remove code duplication.

This commit is contained in:
Karishma Chadha 2018-06-06 17:22:05 -04:00
parent d583205cdd
commit 4843e35894

View file

@ -235,19 +235,17 @@ Blockly.BubbleDragger.prototype.endBubbleDrag = function(
* @private
*/
Blockly.BubbleDragger.prototype.fireMoveEvent_ = function() {
var event = null;
if (this.draggingBubble_.isComment) {
var event = new Blockly.Events.CommentMove(this.draggingBubble_);
event.setOldCoordinate(this.startXY_);
event.recordNew();
Blockly.Events.fire(event);
event = new Blockly.Events.CommentMove(this.draggingBubble_);
} else if (this.draggingBubble_ instanceof Blockly.ScratchBubble) {
var event = new Blockly.Events.CommentMove(this.draggingBubble_.comment);
event.setOldCoordinate(this.startXY_);
event.recordNew();
Blockly.Events.fire(event);
event = new Blockly.Events.CommentMove(this.draggingBubble_.comment);
} else {
return;
}
// TODO (fenichel): move events for comments.
return;
event.setOldCoordinate(this.startXY_);
event.recordNew();
Blockly.Events.fire(event);
};
/**