Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/blockly/core/dragging/block_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,10 @@ export class BlockDragStrategy implements IDragStrategy {
this.applyConnections(this.connectionCandidate);
this.disposeStep();
} else {
// play a sound if the block didn't connect to anything and isn't being deleted
if (disposition !== DragDisposition.DELETE) {
this.workspace.getAudioManager().play('drop');
}
this.block.queueRender().then(() => this.disposeStep());
}

Expand Down
1 change: 1 addition & 0 deletions packages/blockly/core/dragging/comment_drag_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class CommentDragStrategy implements IDragStrategy {
this.workspace
.getLayerManager()
?.moveOffDragLayer(this.comment, layers.BLOCK);
this.workspace.getAudioManager().play('drop');
this.comment.setDragging(false);

this.comment.snapToGrid();
Expand Down
1 change: 1 addition & 0 deletions packages/blockly/core/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,5 @@ function loadSounds(pathToMedia: string, workspace: WorkspaceSvg) {
audioMgr.load([`${pathToMedia}click.mp3`], 'click');
audioMgr.load([`${pathToMedia}disconnect.mp3`], 'disconnect');
audioMgr.load([`${pathToMedia}delete.mp3`], 'delete');
audioMgr.load([`${pathToMedia}drop.mp3`], 'drop');
}
Binary file added packages/blockly/media/drop.mp3
Binary file not shown.
Loading