aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/draggable.js16
-rw-r--r--p/scripts/integration.js4
2 files changed, 16 insertions, 4 deletions
diff --git a/p/scripts/draggable.js b/p/scripts/draggable.js
index 8b98346f6..5e99e3227 100644
--- a/p/scripts/draggable.js
+++ b/p/scripts/draggable.js
@@ -27,6 +27,10 @@ const init_draggable_list = function () {
draggableList.addEventListener('dragstart', event => {
source = event.target.closest('[draggable="true"]');
+ const dragbox = source.closest('.dragbox');
+ if (dragbox) {
+ source = dragbox;
+ }
event.dataTransfer.setData('text/html', source.outerHTML);
event.dataTransfer.effectAllowed = 'move';
});
@@ -36,7 +40,11 @@ const init_draggable_list = function () {
return;
}
- const draggableItem = event.target.closest('[draggable="true"]');
+ let draggableItem = event.target.closest('[draggable="true"]');
+ const dragbox = event.target.closest('.dragbox');
+ if (dragbox) {
+ draggableItem = dragbox;
+ }
if (null === draggableItem || source === draggableItem) {
return;
}
@@ -59,7 +67,11 @@ const init_draggable_list = function () {
return;
}
- const draggableItem = event.target.closest('[draggable="true"]');
+ let draggableItem = event.target.closest('[draggable="true"]');
+ const dragbox = event.target.closest('.dragbox');
+ if (dragbox) {
+ draggableItem = dragbox;
+ }
if (null === draggableItem || source === draggableItem) {
return;
}
diff --git a/p/scripts/integration.js b/p/scripts/integration.js
index acd629573..d837ac9a0 100644
--- a/p/scripts/integration.js
+++ b/p/scripts/integration.js
@@ -21,7 +21,7 @@ const init_integration = function () {
newShare = newShare.replace(/##key##/g, shares);
newShare = newShare.replace(/##method##/g, shareType.getAttribute('data-method'));
newShare = newShare.replace(/##field##/g, shareType.getAttribute('data-field'));
- event.target.closest('.form-group').insertAdjacentHTML('beforebegin', newShare);
+ event.target.closest('formgroup').insertAdjacentHTML('beforebegin', newShare);
shares++;
});
@@ -30,7 +30,7 @@ const init_integration = function () {
return;
}
- const deleteButton = event.target.closest('a.remove');
+ const deleteButton = event.target.closest('.remove');
if (null === deleteButton || !deleteButton.closest) {
return;
}