Skip to content

Commit

Permalink
Rollup merge of rust-lang#49312 - GuillaumeGomez:fix-ie11-search, r=Q…
Browse files Browse the repository at this point in the history
…uietMisdreavus

Fix IE11 search

Fixes rust-lang#49263.

r? @QuietMisdreavus

I got this code from: https://stackoverflow.com/a/30867255/7879548
  • Loading branch information
alexcrichton authored Mar 23, 2018
2 parents 0615e6b + 90588a9 commit 8cb9b83
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@

var themesWidth = null;

if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}

function hasClass(elem, className) {
if (elem && className && elem.className) {
var elemClass = elem.className;
Expand Down

0 comments on commit 8cb9b83

Please sign in to comment.