Skip to content

Commit

Permalink
gsuiOscillator: accept buf from libs to changeSource
Browse files Browse the repository at this point in the history
  • Loading branch information
mr21 committed Feb 13, 2024
1 parent e08d1d7 commit 410f633
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions gsuiOscillator/gsuiOscillator.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ class gsuiOscillator extends gsui0ne {
return false;
};
this.ondrop = e => {
const data = e.dataTransfer.getData( "pattern-buffer" );
const tar = e.target.closest( "gsui-oscillator, .gsuiOscillator-waveWrap" );
const act = tar.nodeName === "GSUI-OSCILLATOR" ? "drop" : "wavedrop";
const patBufId = e.dataTransfer.getData( "pattern-buffer" );
const defBufId = e.dataTransfer.getData( "library-buffer:default" );
const locBufId = e.dataTransfer.getData( "library-buffer:local" );

if ( data ) {
const tar = e.target.closest( "gsui-oscillator, .gsuiOscillator-waveWrap" );
const act = tar.nodeName === "GSUI-OSCILLATOR" ? "drop" : "wavedrop";

this.$dispatch( act, data );
}
if ( patBufId ) { this.$dispatch( act, "pattern-buffer", patBufId ); }
else if ( defBufId ) { this.$dispatch( act, "library-buffer:default", defBufId ); }
else if ( locBufId ) { this.$dispatch( act, "library-buffer:local", locBufId ); }
return false;
};
GSUlistenEvents( this, {
Expand Down

0 comments on commit 410f633

Please sign in to comment.