Closed rstacruz closed 9 years ago
also some breakages I've found: this IE workaround actually breaks things because el
in this case is the document root element (<html>
), which can't be inserted into the document.body
of course.
forEachEls(els, function(el) {
var domFix = false
- if (!el.parentNode) {
// THANKS YOU IE (9/10//11 concerned)
// dispatchEvent doesn't work if element is not in the dom
- domFix = true
- document.body.appendChild(el)
- }
el.dispatchEvent(event)
- if (domFix) {
- el.parentNode.removeChild(el)
- }
})
Another: onSwitch
is not available here because this
isn't what you think it is—it's probably simply missing a .bind
somewhere.
module.exports = {
outerHTML: function(oldEl, newEl) {
oldEl.outerHTML = newEl.outerHTML
- this.onSwitch()
},
innerHTML: function(oldEl, newEl) {
oldEl.innerHTML = newEl.innerHTML
oldEl.className = newEl.className
- this.onSwitch()
},
I guess the hirerarchy error come from the IE workaround :/ For the onSwitch, it's probably because I didn't finish what I started.
That why I added a failing test, to remember where to continue :)
okay—removed the removal of that test, so it should fail now. this PR should at least give you a nice example to replicate #39.
Thanks for this.
This adds examples to
/example
. This shows that the plugin right now is at a state that doesn't actually work:I've removed the failing test now so the test suite should pass, but that's no indicator that the project is in a working state.