Actually, now that I'm trying to work it out, it seems that the
previous event is not being overwritten – which is not too good – I'd
have to remove it first and attach a new one.

So the real question now is, how do I check if an element has any
attached events and what do these events trigger?

O.

On Dec 21, 1:33 am, Oskar Krawczyk <[email protected]> wrote:
> Hi Folks, hope you're well!
>
> Please consider the scenario below:
>
> 1. A user gets a form he might or might not fill.
>
> 2. If a user has modified the field, every link on the webpage should
> get an event applied to itself.
>
> 3. Clicking on one of the links would display a popup (a html one, not
> the alert() thing) asking for confirmation whether we want to leave
> the page without saving or not.
>
> 4. Now, in some cases a link on the page would already have an event
> attached – bummer, it gets overwritten by the new one and we're left
> with out pants down.
>
> You can see my pain. I was considering storing the default event –
> this.store('default:event', e) – but that would clearly work only when
> the actual event gets triggered.
>
> Maybe it's the late hour but I don't see any easy solution to get
> successfully through the scenario.
>
> Any suggestions?
>
> Best,
> Oskar

Reply via email to