move matchMedia polyfill to carousel

This commit is contained in:
afc163 2015-11-20 10:57:08 +08:00
parent d50460724a
commit 3597e6a576
2 changed files with 15 additions and 15 deletions

View File

@ -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';

View File

@ -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'),