about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-03-25 01:26:45 +0800
committerGitHub <noreply@github.com>2018-03-25 01:26:45 +0800
commit2580edfba09950b7f882272a5d8c12070e7c63ee (patch)
tree34fd19dfe6d5163e79a6a7e40476b5b0d2d53150
parent177e20de322d03a6da426b83458f7e92d47d6fc5 (diff)
parent90588a9086270ecaebe1dab6bcff1dcbacfe1c0e (diff)
downloadrust-2580edfba09950b7f882272a5d8c12070e7c63ee.tar.gz
rust-2580edfba09950b7f882272a5d8c12070e7c63ee.zip
Rollup merge of #49312 - GuillaumeGomez:fix-ie11-search, r=QuietMisdreavus
Fix IE11 search

Fixes #49263.

r? @QuietMisdreavus

I got this code from: https://stackoverflow.com/a/30867255/7879548
-rw-r--r--src/librustdoc/html/static/main.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 21c1d9d670d..6c6c067f951 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -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;