Skip to content

Commit

Permalink
Merge pull request #3491 from plotly/3489-v-modebar-ie11-pr
Browse files Browse the repository at this point in the history
replace prepend() calls since they aren't supported in IE11
  • Loading branch information
antoinerg authored Jan 29, 2019
2 parents ea7941b + 4b164a2 commit b1fd7d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/modebar/modebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ proto.update = function(graphInfo, buttons) {
}

if(fullLayout.modebar.orientation === 'v') {
this.element.prepend(logoGroup);
this.element.insertBefore(logoGroup, this.element.childNodes[0]);
} else {
this.element.appendChild(logoGroup);
}
Expand Down
12 changes: 12 additions & 0 deletions test/jasmine/assets/unpolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@
].join(' '));
}
});

Object.defineProperty(item, 'prepend', {
configurable: true,
enumerable: true,
writable: true,
value: function remove() {
throw Error([
'test/jasmine/assets/unpolyfill.js error: calling ChildNode.prepend()',
'which is not available in IE.'
].join(' '));
}
});
});
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);

0 comments on commit b1fd7d6

Please sign in to comment.