Commit 3cdcc2d6 authored by Julien Cigar's avatar Julien Cigar
Browse files

Fix document.importNode in IE9.

document.importNode exists in IE9 but fails. Just fails. It's not implemented, just says it's there and fails when called *sigh*.
parent fa6f48c0
......@@ -12,7 +12,7 @@
* "THE BEER-WARE LICENSE" (Revision 42):
* <julien.cigar@gmail.com> wrote this file. As long as you retain this notice
* you can do whatever you want with this stuff. If we meet some day, and you
* think this stuff is worth it, you can buy me a beer in return Julien Cigar.
* think this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/
......@@ -394,10 +394,13 @@
deep = true;
}
return document.importNode ?
document.importNode(node, deep) :
(function(node, deep) {
/* Note: document.importNode exists in IE9 but fails. Just fails. It's
* not implemented, just says it's there and fails when called.
*/
try {
return document.importNode(node, deep) :
} catch(e) {
return (function(node, deep) {
/* Returns an integer code representing the type of the node. */
var NodeTypes = {
ELEMENT_NODE : 1,
......@@ -461,6 +464,7 @@
}
})(node, deep);
}
}
/* Yeti.DOM.firstElementChild
* Returns a reference to the first child node of that element which is of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment