Browse Source

move matchMedia polyfill to carousel

pull/562/head
afc163 9 years ago
parent
commit
3597e6a576
  1. 15
      components/carousel/index.jsx
  2. 15
      index.js

15
components/carousel/index.jsx

@ -1,3 +1,18 @@
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
if (typeof window !== 'undefined') {
const matchMediaPolyfill = function matchMediaPolyfill() {
return {
matches: false,
addListener: function () {
},
removeListener: function () {
}
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
}
import Carousel from 'react-slick';
import React from 'react';
import assign from 'object-assign';

15
index.js

@ -2,21 +2,6 @@ import React from 'react';
require('./style/index.less');
// matchMedia polyfill for
// https://github.com/WickyNilliams/enquire.js/issues/82
if (typeof window !== 'undefined') {
const matchMediaPolyfill = function matchMediaPolyfill() {
return {
matches: false,
addListener: function () {
},
removeListener: function () {
}
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
}
const antd = {
Affix: require('./components/affix'),
Datepicker: require('./components/datepicker'),

Loading…
Cancel
Save