Merge branch 'master' of github.com:ant-design/ant-design

This commit is contained in:
afc163 2016-09-10 14:11:10 +08:00
commit 0e1be22785
4 changed files with 23 additions and 7 deletions

View File

@ -19,3 +19,11 @@ Please note that Affix should not cover other content in page, especially when t
| offsetTop | Pixels to offset from top when calculating position of scroll | Number | 0 |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | Number | - |
| onChange | Callback when affix state is changed | Function(affixed) | - |
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
```jsx
<Affix style={{ position: 'absolute', top: y, left: x}}>
...
</Affix>
```

View File

@ -15,10 +15,17 @@ english: Affix
## API
| 成员 | 说明 | 类型 | 默认值 |
|-------------|----------------|--------------------|--------------|
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | |
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window |
| onChange | 固定状态改变时触发的回调函数 | Function(affixed) | 无 |
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:
```jsx
<Affix style={{ position: 'absolute', top: y, left: x}}>
...
</Affix>
```

View File

@ -3,10 +3,10 @@ import Promise from 'bluebird';
import MainContent from './MainContent';
// locale copy from layout
const locale = (
window.localStorage &&
localStorage.getItem('locale') !== 'en-US'
) ? 'zh-CN' : 'en-US';
const language = (typeof localStorage === 'undefined' || !localStorage.getItem('locale')) ?
navigator.language : localStorage.getItem('locale');
const isZhCN = language === 'zh-CN';
const locale = isZhCN ? 'zh-CN' : 'en-US';
export function collect(nextProps, callback) {
const pageData = nextProps.location.pathname === 'changelog' ?

View File

@ -12,8 +12,9 @@ window.react = React;
window['react-dom'] = ReactDOM;
window.antd = require('antd');
const isZhCN = (typeof localStorage !== 'undefined' && localStorage.getItem('locale') === 'zh-CN') ||
(navigator.language === 'zh-CN');
const language = (typeof localStorage === 'undefined' || !localStorage.getItem('locale')) ?
navigator.language : localStorage.getItem('locale');
const isZhCN = language === 'zh-CN';
const appLocale = isZhCN ? cnLocale : enLocale;
addLocaleData(appLocale.data);