IE9 fix - add createContextualFragment workaround
authorAlan Knowles <alan@akbkhome.com>
Thu, 7 Jul 2011 06:08:26 +0000 (06:08 +0000)
committerAlan Knowles <alan@akbkhome.com>
Wed, 7 Sep 2011 02:05:22 +0000 (10:05 +0800)
Roo/DomHelper.js

index 93f0144..6b4ff27 100644 (file)
@@ -8,7 +8,22 @@
  * Fork - LGPL
  * <script type="text/javascript">
  */
+
+
+// nasty IE9 hack - what a pile of crap that is..
+
+ if (typeof Range.prototype.createContextualFragment == "undefined") {
+    Range.prototype.createContextualFragment = function (html) {
+        var doc = window.document;
+        var container = doc.createElement("div");
+        container.innerHTML = html;
+        var frag = doc.createDocumentFragment(), n;
+        while ((n = container.firstChild)) {
+            frag.appendChild(n);
+        }
+        return frag;
+    };
+}
 
 /**
  * @class Roo.DomHelper