Skip to content

Commit

Permalink
[new] add legacy flebox UA className
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed May 23, 2016
1 parent 668dd50 commit 3aa23d4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

- [Flexbox](http://caniuse.com/#feat=flexbox)

Amaze UI Touch 完全基于 flexbox 布局。由于[旧版规范](http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/)中没有 `flex-shrink``flex-basis``flex-wrap` 对应的属性,导致只支持旧版规范的浏览器无法正常渲染布局暂时[没有找到解决方法(望赐教)](https://github.com/amazeui/amazeui-touch/issues/12) :( 。
Amaze UI Touch 完全基于 flexbox 布局。由于[旧版规范](http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/)中没有 `flex-shrink``flex-basis``flex-wrap` 对应的属性,导致只支持旧版规范的浏览器无法正常渲染布局,暂时[~~没有找到解决方法(望赐教)~~](https://github.com/amazeui/amazeui-touch/issues/12) 通过回退方式处理,在 Android UC 上测试通过,有待进行更多测试 :( 。
- [CSS3 Transitions](http://caniuse.com/#feat=css-transitions)
- [CSS Animation](http://caniuse.com/#feat=css-animation)

Expand Down
2 changes: 0 additions & 2 deletions docs/navbar/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,4 @@ if (/android/i.test(ua) && /ucbrowser/i.test(ua)) {
}
```

由于测试面有限,上面的 JS 暂未添加到源码, 需要开发者手动添加到项目中(样式已经集成在 CSS 文件中,)。

## 示例
6 changes: 0 additions & 6 deletions kitchen-sink/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,5 @@
<div id="sk-root" style="height: 100%; width: 100%; overflow: hidden;">
</div>
<script src="app__ENV__.js"></script>
<script>
var ua = navigator.userAgent;
if (/android/i.test(ua) && /ucbrowser/i.test(ua)) {
document.documentElement.className += ' ua-stupid-uc';
}
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ export {default as View} from './View';

// Mixins
export * from './mixins';

// Compatibility fallback
import './utils/fallback';
10 changes: 10 additions & 0 deletions src/js/utils/fallback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Android browsers legacy flexbox fallback
try {
const ua = navigator.userAgent;

// TODO:
// - add version detecting when UC supports flexbox
if (/android/i.test(ua) && /ucbrowser/i.test(ua)) {
document.documentElement.className += ' ua-stupid-uc';
}
} catch(e) {}

0 comments on commit 3aa23d4

Please sign in to comment.