Permalink
Browse files

fix(navbar): polyfill for search on ie11

  • Loading branch information...
katrin-freihofner committed Jul 6, 2017
1 parent a32b8a1 commit e47c7e0e10f29654207154de90c6431218b6019c
Showing with 10 additions and 0 deletions.
  1. +4 −0 package.json
  2. +6 −0 src/navbar/navbar.js
View
@@ -60,5 +60,9 @@
"through2": "^2.0.1",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.7.0"
},
"dependencies": {
"promise-polyfill": "^6.0.2",
"whatwg-fetch": "^2.0.3"
}
}
View
@@ -1,5 +1,7 @@
import $ from '../js-common-components/dollar';
import { debounce } from '../js-common-components/utils';
import Promise from 'promise-polyfill';
import 'whatwg-fetch';
function clearResults(select) {
while (select.firstChild) {
@@ -17,6 +19,10 @@ function createListElement(result, opts) {
}
function fetchResults(select, searchData, params, opts) {
if (!window.Promise) {
window.Promise = Promise;
}
fetch(`${searchData}?${params}`)
.catch(() => '{ results: [] }')
.then(res => res.json())

0 comments on commit e47c7e0

Please sign in to comment.