fix: fix IE11 crash + remove unused polyfills

fixes #448
This commit is contained in:
Roman Hotsiy 2018-06-20 18:51:54 +03:00
parent 5dae267a54
commit c8a5f36f17
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
6 changed files with 13 additions and 12 deletions

View File

@ -14,8 +14,6 @@ export interface RequestSamplesProps {
export class RequestSamples extends React.Component<RequestSamplesProps> {
operation: OperationModel;
visited = new Set();
render() {
const { operation } = this.props;
const requestBodyContent = operation.requestBody && operation.requestBody.content;

View File

@ -24,8 +24,6 @@ export interface ResponseSamplesProps {
export class ResponseSamples extends React.Component<ResponseSamplesProps> {
operation: OperationModel;
visited = new Set();
render() {
const { operation } = this.props;
const responses = operation.responses.filter(response => {

View File

@ -10,7 +10,7 @@ import { AnimatedChevronButton } from './ChevronSvg';
let Stickyfill;
if (IS_BROWSER) {
Stickyfill = require('stickyfill').default;
Stickyfill = require('stickyfill');
}
export interface StickySidebarProps {

View File

@ -1,9 +1,8 @@
import 'core-js/es6/promise';
import 'core-js/fn/object/assign';
import 'core-js/fn/string/starts-with';
import 'core-js/fn/string/ends-with';
import 'core-js/fn/array/find';
import 'core-js/fn/object/assign';
import 'core-js/fn/string/ends-with';
import 'core-js/fn/string/starts-with';
import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js/es6/symbol';

View File

@ -51,7 +51,8 @@ export class ScrollService {
if (el === null) {
return;
}
return Math.trunc(el.getBoundingClientRect().top) <= this.options.scrollYOffset();
const top = el.getBoundingClientRect().top;
return (top > 0 ? Math.floor(top) : Math.ceil(top)) <= this.options.scrollYOffset();
}
subscribe(cb): () => void {

View File

@ -1,5 +1,11 @@
import * as lunr from 'lunr';
try {
require('core-js/es6/promise'); // bundle into worker
} catch (_) {
// nope
}
/* just for better typings */
export default class Worker {
add: typeof add = add;
@ -72,8 +78,7 @@ export async function search<Meta = string>(
}
let searchResults = (await index).query(t => {
q
.trim()
q.trim()
.toLowerCase()
.split(/\s+/)
.forEach(term => {