Skip to content

Commit

Permalink
drop: initialize E with params publiclab#8670
Browse files Browse the repository at this point in the history
  • Loading branch information
noi5e committed Jan 8, 2021
1 parent 5adc893 commit 364beba
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/assets/javascripts/dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ jQuery(function() {
$('.dropzone').on('drop',function(e) {
$D.selected = $(e.target).closest('div.comment-form-wrapper').eq(0);
e.preventDefault();
$E.initialize({
textarea: $D.selected[0].querySelector('textarea').id
});
let params = {};
if ($D.selected.hasOwnProperty(0)) {
params['textarea'] = $D.selected[0].querySelector('textarea').id
} else {
params['textarea'] = 'text-input'
};
$E.initialize(params);
});
$('#side-dropzone').on('drop',function(e) {
e.preventDefault();
Expand Down

0 comments on commit 364beba

Please sign in to comment.