Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec0ddd8

Browse filesBrowse files
authored
Merge pull request #3187 from plotly/custom-modebar-ie11-fix
Fix modebar <style> update in IE11
2 parents 0124828 + 935bd29 commit ec0ddd8
Copy full SHA for ec0ddd8

File tree

Expand file treeCollapse file tree

3 files changed

+25
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+25
-2
lines changed

‎src/lib/index.js

Copy file name to clipboardExpand all lines: src/lib/index.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ lib.addRelatedStyleRule = function(uid, selector, styleString) {
713713
lib.deleteRelatedStyleRule = function(uid) {
714714
var id = 'plotly.js-style-' + uid,
715715
style = document.getElementById(id);
716-
if(style) style.remove();
716+
if(style) lib.removeElement(style);
717717
};
718718

719719
lib.isIE = function() {

‎test/jasmine/assets/unpolyfill.js

Copy file name to clipboard
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Un-polyfills - to be included in karma.conf.js to catch
3+
* browser-dependent errors.
4+
*/
5+
6+
'use strict';
7+
8+
(function(arr) {
9+
arr.forEach(function(item) {
10+
Object.defineProperty(item, 'remove', {
11+
configurable: true,
12+
enumerable: true,
13+
writable: true,
14+
value: function remove() {
15+
throw Error([
16+
'test/jasmine/assets/unpolyfill.js error: calling ChildNode.remove()',
17+
'which is not available in IE.'
18+
].join(' '));
19+
}
20+
});
21+
});
22+
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);

‎test/jasmine/karma.conf.js

Copy file name to clipboardExpand all lines: test/jasmine/karma.conf.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ var pathToStrictD3 = path.join(__dirname, '..', '..', 'tasks', 'util', 'strict_d
106106
var pathToJQuery = path.join(__dirname, 'assets', 'jquery-1.8.3.min.js');
107107
var pathToIE9mock = path.join(__dirname, 'assets', 'ie9_mock.js');
108108
var pathToCustomMatchers = path.join(__dirname, 'assets', 'custom_matchers.js');
109+
var pathToUnpolyfill = path.join(__dirname, 'assets', 'unpolyfill.js');
109110

110111
var reporters = (isFullSuite && !argv.tags) ? ['dots', 'spec'] : ['progress'];
111112
if(argv.failFast) reporters.push('fail-fast');
@@ -142,7 +143,7 @@ func.defaultConfig = {
142143
// list of files / patterns to load in the browser
143144
//
144145
// N.B. the rest of this field is filled below
145-
files: [pathToCustomMatchers],
146+
files: [pathToCustomMatchers, pathToUnpolyfill],
146147

147148
// list of files / pattern to exclude
148149
exclude: [],

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.