Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(utilities): undefined parentElement in IE11
  • Loading branch information
fmal committed Apr 23, 2016
1 parent b887b26 commit c7bb785
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utilities.js
Expand Up @@ -12,7 +12,13 @@ export function insertBeforeNode(view: View, bottomBuffer: number): void {
let viewStart = view.firstChild;
let element = viewStart.nextSibling;
let viewEnd = view.lastChild;
let parentElement = bottomBuffer.parentElement;
let parentElement;

if (bottomBuffer.parentElement) {
parentElement = bottomBuffer.parentElement;
} else if (bottomBuffer.parentNode) {
parentElement = bottomBuffer.parentNode;
}

parentElement.insertBefore(viewEnd, bottomBuffer);
parentElement.insertBefore(element, viewEnd);
Expand Down

0 comments on commit c7bb785

Please sign in to comment.