Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,6 @@ | ||
# v1.3.0 Fire Bug | ||
- Use `fireEvent` and `createEventObject` when their modern counterparts are missing | ||
- Use `setCapture` and `releaseCapture` when modern event handling methods are missing | ||
# v1.2.0 Flag The Bug | ||
@@ -2,0 +7,0 @@ |
{ | ||
"name": "crossvent", | ||
"description": "Cross-platform browser event handling", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"homepage": "https://github.com/bevacqua/crossvent", | ||
@@ -6,0 +6,0 @@ "author": { |
'use strict'; | ||
var doc = document; | ||
var addEvent = addEventEasy; | ||
@@ -17,3 +18,6 @@ var removeEvent = removeEventEasy; | ||
function addEventHard (el, type, fn, capturing) { | ||
return el.attachEvent('on' + type, wrap(el, type, fn), capturing); | ||
if (capturing) { | ||
el.setCapture(); | ||
} | ||
return el.attachEvent('on' + type, wrap(el, type, fn)); | ||
} | ||
@@ -26,9 +30,18 @@ | ||
function removeEventHard (el, type, fn, capturing) { | ||
return el.detachEvent('on' + type, unwrap(el, type, fn), capturing); | ||
if (capturing) { | ||
el.releaseCapture(); | ||
} | ||
return el.detachEvent('on' + type, unwrap(el, type, fn)); | ||
} | ||
function fabricateEvent (el, type) { | ||
var e = document.createEvent('Event'); | ||
e.initEvent(type, true, true); | ||
el.dispatchEvent(e); | ||
var e; | ||
if (doc.createEvent) { | ||
e = doc.createEvent('Event'); | ||
e.initEvent(type, true, true); | ||
el.dispatchEvent(e); | ||
} else if (doc.createEventObject) { | ||
e = doc.createEventObject(); | ||
el.fireEvent('on' + type, e); | ||
} | ||
} | ||
@@ -35,0 +48,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18288
275