Skip to content
Snippets Groups Projects
Commit c9b60dd5 authored by Andreas Fernandez's avatar Andreas Fernandez
Browse files

[BUGFIX] Use event delegation for image manipulation triggers

With the dismissal of jQuery and jQuery UI from the image manipulation
component, the event handling for the trigger button ("Open Editor")
got borked as the event state toggling previously done via
`.off(...).on(...)` was replaced with using a `signal` as
documented at [1]. The `AbortController` instance is only built when
the modal has been fully shown, way after the event handling took
place, breaking the module's global state.

To solve this issue we removed the `AbortController` and its usages
again. Also, `initializeTrigger()` now uses event delegation to register
the event handler on the trigger buttons.

As a drive-by fixes, the `active` state of the ratio buttons is now
properly toggled, and the ratio title field is correctly updated by
comparing with the scoped `ratioTitleWindow.HTMLElement` prototype.

[1] https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#add_an_abortable_listener

Resolves: #101150
Resolves: #101199
Related: #100948
Releases: main, 12.4
Change-Id: I021c74bb67976468ebdc5226263c6441796bd65b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79555


Reviewed-by: default avatarThomas Hohn <tho@gyldendal.dk>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarOliver Hader <oliver.hader@typo3.org>
parent 35a4c605
Branches
Tags
No related merge requests found
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