mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Remove code duplication.
This commit is contained in:
parent
d583205cdd
commit
4843e35894
1 changed files with 8 additions and 10 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue