Skip to content
Snippets Groups Projects
Commit 8922a37a authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Benni Mack
Browse files

[FEATURE] Trigger event after modals dismiss

A new event ``modal-destroyed`` is triggered after modals dismissed.

Change-Id: Id05bf17889889bf1bacbd6a6ad3023923899671d
Resolves: #73720
Releases: master
Reviewed-on: https://review.typo3.org/46933


Reviewed-by: default avatarJan Helke <typo3@helke.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent efa96ba5
Branches
Tags
No related merge requests found
......@@ -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) {
......
============================================================
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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment