Permalink
Browse files

Fix the IE8 body re-assignment bug.

Before loading a suite Konacha replaces the `body` element to have a clean
slate:

```js
document.body = document.createElement('body');
```

However, IE8 does not support this and throws a `Member not found.` error.
Instead of assigning a new body element replace the current element in place.
This seems to satisfy all browsers, even IE8.
  • Loading branch information...
1 parent 81ad820 commit cc2a061827151f0336bda077563a3c138a741493 @kaukas kaukas committed with Oct 24, 2016
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/assets/javascripts/konacha/iframe.js
@@ -1,6 +1,9 @@
window.Konacha = {
reset: function() {
- document.body = document.createElement('body');
+ document.body.parentNode.replaceChild(
+ document.createElement('body'),
+ document.body
+ );
document.body.id = 'konacha';
}
};

0 comments on commit cc2a061

Please sign in to comment.