Review 12.4 Merged

79632[BUGFIX] Use event delegation for image manipulation triggers

Andreas Kienast CR +2 V +2 Normal +29 −32 updated 07/03/23, 16:11

Commit message

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

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
  • Verified V +2 Done
    • Andreas Kienast +2
    • core-ci +1 CI

Issues 3

Files 2

Review log 34

  1. Andreas Kienast commented on patch set 1 07/03/23, 16:03

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 07/03/23, 16:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43258

  3. Andreas Kienast voted on patch set 1 V +2 CR +2 07/03/23, 16:11

  4. Andreas Kienast merged patch set 2 07/03/23, 16:11