Package Exports
- copy-event-attributes
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (copy-event-attributes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
copy-event-attributes
This was pulled out of yo-yo because I wanted the nicer morphdom it provides, but without the dependency on bel
usage
var copyEvents = require('copy-event-attributes')
copyEvents(fromEl, toEl)
usage with morphdom
var copyEvents = require('copy-event-attributes')
var morphdom = require('morphdom')
morphdom(fromEl, toEl, {
onBeforeMorphEl: copyEvents
})
usage with custom events
var copyEvents = require('copy-event-attributes')
var morphdom = require('morphdom')
function copyCustomEvents (fromEl, toEl) {
return copyEvents(fromEl, toEl, ['onmyevent'])
}
morphdom(fromEl, toEl, {
onBeforeMorphEl: copyCustomEvents
})