sidewinderlabs/backplanejs — Issue #128: Event handling broken by changes in f07e8fc3b4
Author: fdintino
Created: 2011-11-01 22:06:46+00:00
State: open
Labels: module-XForms, priority-high, type-defect

[UX.Element](https://github.com/sidewinderlabs/backplanejs/blob/f07e8fc3b4f00461f321244a8c198b49e4d997b3/third-party/uxf/src/lib/backplane/dom/eventTargetProxy.js#L571-637) and [UX.Element.Event](https://github.com/sidewinderlabs/backplanejs/blob/f07e8fc3b4f00461f321244a8c198b49e4d997b3/third-party/uxf/src/lib/backplane/dom/eventTargetProxy.js#L640-698) were introduced in commit f07e8fc3b4 as an attempt to abstract away the differences between IE and W3C DOM event attachment.

UX.Element.Event adds a method `stop()` that chains together `stopPropagation()` and `preventDefault()`. In a few places, code like this:

```javascript
if (UX.isIE && window.event) {
window.event.cancelBubble = true;
window.event.returnValue = false;
} else if (e) {
e.stopPropagation();
}
```

was simplified to:

```javascript
e.stop()
```

The problem is that there are still many places where event attachments weren't switched over to use `UX.Element.addEvent()`, and since `Event.prototype.stop()` isn't a real DOM 2 Event method, an exception is thrown.

Additionally, the [`mapclick2domactivate`](https://github.com/sidewinderlabs/backplanejs/blob/b9a5bee92912a553a7fe776ce03e9e7bee8e9da1/third-party/uxf/src/lib/backplane/dom/eventTargetProxy.js#L65-81) function was removed in this commit, apparently by accident.