Problem/Motivation
Currently, the javascript selects the modal footer and modal background as hardcoded close triggers.
However, there are several cases where users want to add custom triggers or add other elements (such as links) to the footer. While the links will work, the modal will close, too.

Steps to reproduce
Proposed resolution
Use a data-attribute (data-ouibounce-close with querySelectorAll() to get all close triggers.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork ouibounce_exit_modal-3385648
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyIs this something that should instead be solved in the library upstream?
Comment #3
thomas.frobieterI don't know, the close triggers where defined in the module js before ... its 4 lines of code (while the JS is reduced 1/3 by this change).
So creating a issue in the library, waiting for implementation ..... meh.
Comment #4
thomas.frobieterDone! Already tested, please review (:
https://git.drupalcode.org/issue/ouibounce_exit_modal-3385648/-/commit/7...
Comment #6
anybodyPlease do not forget to open a MR from the issue fork and set the status to "Needs Review".
Comment #7
thomas.frobieterDone! Review again pls.
Comment #8
anybodyAlternative: #3437774: Replace ouibounce by vanilla JS + Drupal dialog modal [5.0]
But we could still finish this.
Comment #10
grevil commentedAll done and tested! Please review!
I hope the ESLint formatting is not too unrelated.
Comment #11
anybodyVERY nice improvements @thomas.frobieter and @grevil! I left one final comment.
If this was well tested, I think it's ready for RTBC, I just did a code-review.
Comment #12
grevil commentedAll done! Accidentally added the .gitlab-ci, composer.json and generic test here.
Comment #13
anybodyComment #14
grevil commentedComment #15
grevil commentedComment #17
grevil commented