Skip to content

Commit

Permalink
SFX bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lubin Pappalardo committed Oct 8, 2023
1 parent f1305dd commit 686fd58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/scripts/audio-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ function playAudio(audioName, id='', loop=false) {
}

}

function clearAllAudio() {
$('audio').each(function() {
$(this).remove();
});
}
1 change: 1 addition & 0 deletions assets/scripts/components-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ $(document).on('mousedown touchstart', '.add-component', function (e) {
function deleteComponent() {
const id = SelectedComponent.attr('id');
delete diagram[id];
$(`#audio-${id}`).remove();
SelectedComponent.remove();
playAudio('cut.wav');
setDiagram();
Expand Down
1 change: 1 addition & 0 deletions assets/scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function clearBoard() {
diagram = {};
ComponentCount = 0;
$('#loadDiagram').val('');
clearAllAudio();
resetWorkspace();
setDiagram();
deleteCookies();
Expand Down

0 comments on commit 686fd58

Please sign in to comment.