Permalink
Browse files

fix event.stop() for older IE browsers

  • Loading branch information...
1 parent 7365a71 commit 8a205c81e1d21249a09d6c1e79a2feda0f54e015 @rvagg rvagg committed Jan 6, 2012
Showing with 27 additions and 27 deletions.
  1. +13 −13 bean.js
  2. +1 −1 bean.min.js
  3. +13 −13 src/bean.js
View
26 bean.js
@@ -87,28 +87,28 @@
, mouseProps = commonProps.concat('button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement'.split(' '))
, keyProps = commonProps.concat('char charCode key keyCode'.split(' '))
, preventDefault = 'preventDefault'
- , createPreventDefault = function (e) {
+ , createPreventDefault = function (event) {
return function () {
- if (e[preventDefault])
- e[preventDefault]()
+ if (event[preventDefault])
+ event[preventDefault]()
else
- e.returnValue = false
+ event.returnValue = false
}
}
, stopPropagation = 'stopPropagation'
- , createStopPropagation = function (e) {
+ , createStopPropagation = function (event) {
return function () {
- if (e[stopPropagation])
- e[stopPropagation]()
+ if (event[stopPropagation])
+ event[stopPropagation]()
else
- e.cancelBubble = true
+ event.cancelBubble = true
}
}
- , createStop = function (e) {
+ , createStop = function (synEvent) {
return function () {
- e[preventDefault]()
- e[stopPropagation]()
- e.stopped = true
+ synEvent[preventDefault]()
+ synEvent[stopPropagation]()
+ synEvent.stopped = true
}
}
, copyProps = function (event, result, props) {
@@ -130,7 +130,7 @@
result[preventDefault] = createPreventDefault(event)
result[stopPropagation] = createStopPropagation(event)
- result.stop = createStop(event)
+ result.stop = createStop(result)
result.target = target && target.nodeType === 3 ? target.parentNode : target
if (isNative) { // we only need basic augmentation on custom events, the rest is too expensive
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -78,28 +78,28 @@
, mouseProps = commonProps.concat('button buttons clientX clientY dataTransfer fromElement offsetX offsetY pageX pageY screenX screenY toElement'.split(' '))
, keyProps = commonProps.concat('char charCode key keyCode'.split(' '))
, preventDefault = 'preventDefault'
- , createPreventDefault = function (e) {
+ , createPreventDefault = function (event) {
return function () {
- if (e[preventDefault])
- e[preventDefault]()
+ if (event[preventDefault])
+ event[preventDefault]()
else
- e.returnValue = false
+ event.returnValue = false
}
}
, stopPropagation = 'stopPropagation'
- , createStopPropagation = function (e) {
+ , createStopPropagation = function (event) {
return function () {
- if (e[stopPropagation])
- e[stopPropagation]()
+ if (event[stopPropagation])
+ event[stopPropagation]()
else
- e.cancelBubble = true
+ event.cancelBubble = true
}
}
- , createStop = function (e) {
+ , createStop = function (synEvent) {
return function () {
- e[preventDefault]()
- e[stopPropagation]()
- e.stopped = true
+ synEvent[preventDefault]()
+ synEvent[stopPropagation]()
+ synEvent.stopped = true
}
}
, copyProps = function (event, result, props) {
@@ -121,7 +121,7 @@
result[preventDefault] = createPreventDefault(event)
result[stopPropagation] = createStopPropagation(event)
- result.stop = createStop(event)
+ result.stop = createStop(result)
result.target = target && target.nodeType === 3 ? target.parentNode : target
if (isNative) { // we only need basic augmentation on custom events, the rest is too expensive

0 comments on commit 8a205c8

Please sign in to comment.