Skip to content

Commit 1c70f9a

Browse files
committed
replace prepend() calls since they aren't supported in IE11
1 parent e94ee3d commit 1c70f9a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/components/modebar/modebar.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ proto.update = function(graphInfo, buttons) {
8888
}
8989

9090
if(fullLayout.modebar.orientation === 'v') {
91-
this.element.prepend(logoGroup);
91+
d3.select(this.element).insert(function() {
92+
return logoGroup;
93+
}, ':first-child');
9294
} else {
9395
this.element.appendChild(logoGroup);
9496
}

test/jasmine/assets/unpolyfill.js

+12
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,17 @@
1818
].join(' '));
1919
}
2020
});
21+
22+
Object.defineProperty(item, 'prepend', {
23+
configurable: true,
24+
enumerable: true,
25+
writable: true,
26+
value: function remove() {
27+
throw Error([
28+
'test/jasmine/assets/unpolyfill.js error: calling ChildNode.prepend()',
29+
'which is not available in IE.'
30+
].join(' '));
31+
}
32+
});
2133
});
2234
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);

0 commit comments

Comments
 (0)