Skip to content

Commit 553ec02

Browse files
committed
“Fix” the GitHub star buttons on the API Docs page in IE 11
It takes the buttons script an incredibly long time to execute on IE 11 (upwards of 30 seconds), so I’m “progressively degrading” the experience for IE 11 and not upgrading the star links to buttons. Additionally, the npm install command and buttons weren’t being shown because `display: unset` is not supported in IE, so that’s fixed.
1 parent cc8a9e6 commit 553ec02

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

static/canjs.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ function navigate(href, updateLocation) {
288288
var $breadcrumb = $content.find(".breadcrumb");
289289
var homeLink = $content.find(".logo > a").attr('href');
290290

291+
// Remove GitHub star buttons from the main body in IE
292+
if (!!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g)) {
293+
var gitHubButtons = $article.find('.body .github-button');
294+
gitHubButtons.each(function() {
295+
this.classList.remove('github-button');
296+
});
297+
}
298+
291299
//root elements - use .filter; not .find
292300
var $pathPrefixDiv = $content.filter("[path-prefix]");
293301

static/module-list.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
margin: 0;
55
list-style-type: none;
66
list-style: none;
7-
li {
7+
li {
88
list-style-type: none;
99
list-style: none;
1010
}
@@ -43,15 +43,15 @@
4343
position: relative;
4444
margin-left: 5px;
4545
}
46-
> ul {
46+
> ul {
4747
.flex;
4848
justify-content: flex-end;
4949
margin-left: auto;
5050
margin-bottom: 0;
5151
flex-wrap: wrap;
5252
display: none;
5353
@media screen and (min-width: @breakpoint) {
54-
display: unset;
54+
display: block;
5555
}
5656
> li {
5757
display: inline-block;

0 commit comments

Comments
 (0)