Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Commit

Permalink
update host because CORS
Browse files Browse the repository at this point in the history
 🐿 v2.5.16
  • Loading branch information
gvonkoss committed Sep 7, 2017
1 parent 8cffc86 commit 812de05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/n-ui/typeahead/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { SuggestionList } from './suggestion-list';

const React = require('react');
const ReactDom = require('react-dom');
const host = /local(?:host)?\.ft\.com/.test(window.location.host) ? window.location.host : 'www.ft.com';

function getNonMatcher (container) {
if (typeof container === 'string') {
Expand Down Expand Up @@ -32,7 +33,7 @@ class Typeahead {
this.container = containerEl;
this.listComponent = listComponent || SuggestionList;
this.searchEl = this.container.querySelector('[data-typeahead-input]');
this.dataSrc = `//${window.location.host}/search-api/suggestions?partial=`;
this.dataSrc = `//${host}/search-api/suggestions?partial=`;
this.categories = (this.container.getAttribute('data-typeahead-categories') || 'tags').split(',');
this.itemTag = this.container.getAttribute('data-typeahead-item-tag') || 'a';
this.includeViewAllLink = this.container.hasAttribute('data-typeahead-view-all');
Expand Down

0 comments on commit 812de05

Please sign in to comment.