Files
compiler-explorer/static
Ofek 4cdef67bba fix Alert (#6771)
All `Alert` modal windows reuse the same yesButton/noButton.
The callback are setup in the Alert ctor -
```
        const yesNoModal = $('#yes-no');
        yesNoModal.find('button.yes').on('click', () => {
            this.yesHandler?.();
        });
        yesNoModal.find('button.no').on('click', () => {
            this.noHandler?.();
        });
    }
```
On every yes/no click, *All* callbacks of *All* alert instances are
called.
So each `Alert` instance needs to cleanup its callbacks after usage, and
it tries to - via the weirdly named `toggleEventListener`.
`toggleEventListener` only did

```
element.off(eventName);
```
Some of the renaming problems were caused by persistance of [this
callback](https://github.com/compiler-explorer/compiler-explorer/blob/00648a7e1c38c9172c5226d1f64511b8bebfe1c9/static/widgets/pane-renaming.ts#L68-L72).
Extending the cleanup to -
```
        element.off(eventName);
        this.yesHandler = null;
        this.noHandler = null;
```
seems to solve it this particular problem - not even sure `element.off`
is even needed.
2024-08-17 22:50:46 +03:00
..
2024-07-29 22:19:59 -05:00
2024-08-17 22:50:46 +03:00
2024-04-22 21:25:31 +02:00
2024-03-20 22:01:36 -05:00
2023-08-15 22:16:36 -05:00
2024-04-22 21:25:31 +02:00
2023-12-03 13:00:59 -05:00
2023-07-10 21:31:04 -05:00
2024-01-15 18:31:46 -06:00
2024-04-09 20:20:18 -05:00
2023-11-20 22:04:57 -06:00
2024-06-10 21:49:34 -05:00
2024-08-17 22:50:46 +03:00