aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-03-15 22:58:30 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-15 22:58:30 +0100
commitbe5848fd4fa280e5a4606fef25669974414547a5 (patch)
treec11af74c2a64bdf4f1e59a4841d81d77f5977d4d /p/scripts
parentbdf7e4d29d954c3d2c137948577b6872c3de4656 (diff)
Improved: Sharing/Integration configuration (#4269)
* stick plus button to select list * HTML improved very much * drag and drop improved * add URL button * fix remove button behavior * prepare for PR#4238 * improve length of inputs * First draft of documentation of the sharing services * new config option: depricated * i18n for depricated text * Doc: Blogotext depricated to 2023 * dropdown menu with config link and depricated sign * Update entry_bottom.phtml * Update 08_sharing_services.md * Update template.rtl.css * Typo Deprecated/Depricated * typo * updated the documentation comment * Update shares.php * Update app/i18n/fr/conf.php Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Update p/scripts/draggable.js Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Documentation: services from #4270 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
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;
}