diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Modal.js b/typo3/sysext/backend/Resources/Public/JavaScript/Modal.js index eed1538e8d9271209f205657a3fd4596c41b0635..cb2150e496ef23bb735e2e049ba80f9d072c60f0 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Modal.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Modal.js @@ -228,6 +228,7 @@ define(['jquery', Modal.instances.splice(lastIndex, 1); Modal.currentModal = Modal.instances[lastIndex-1]; } + currentModal.trigger('modal-destroyed'); $(this).remove(); // Keep class modal-open on body tag as long as open modals exist if (Modal.instances.length > 0) { diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-73720-TriggerEventAfterModalWindowDismissed.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-73720-TriggerEventAfterModalWindowDismissed.rst new file mode 100644 index 0000000000000000000000000000000000000000..3fb1a481430d25ac2d61461bb522ecc52e971925 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-73720-TriggerEventAfterModalWindowDismissed.rst @@ -0,0 +1,24 @@ +============================================================ +Feature: #73720 - Trigger event after modal window dismissed +============================================================ + +Description +=========== + +A new event ``modal-destroyed`` has been added that will be triggered after a modal window closed. + + +Impact +====== + +Bind to the event ``modal-destroyed`` to achieve custom actions after the modal dismissed. + +Example code: + +.. code-block:: javascript + + var $modal = Modal.confirm(); // stub code + $modal.on('modal-destroyed', function() { + // Reset the selection + $someCombobox.val(''); + }); \ No newline at end of file