Authored by biao

fix flex display issue. code review by LZF

... ... @@ -37,19 +37,28 @@ function hiddenTips($ele) {
}
}
function isFlexSupport() {
var flex = document.createElement('p').style.flex,
webkitFlex = document.createElement('p').style.webkitFlex,
flexWrap = document.createElement('p').style.flexWrap;
if ((flex === '' || webkitFlex === '') && flexWrap === '') {
return true;
} else {
return false;
//function isFlexSupport() {
// var flex = document.createElement('p').style.flex,
// webkitFlex = document.createElement('p').style.webkitFlex,
// flexWrap = document.createElement('p').style.flexWrap;
//
// if ((flex === '' || webkitFlex === '') && flexWrap === '') {
// return true;
// } else {
// return false;
// }
//}
function wrapElements(selector, count) {
$(selector).each(function(idx, el) {
if (idx % count === 0) {
$($(selector).slice(idx, idx + count)).wrapAll($('<div class="js-wraper"></div>'));
}
});
}
function search() {
if (searching || end) {
return;
... ... @@ -84,9 +93,10 @@ function search() {
hiddenTips($('#size-swiper-container'));
hiddenTips($('#reference-swiper-container'));
if (!isFlexSupport()) {
$('.detail .column').removeClass('column').addClass('oldbox');
}
//if (!isFlexSupport()) {
// $('.detail .column').removeClass('column').addClass('oldbox');
//}
wrapElements('.detail .column', 2);
searching = false;
end = true;
loading.hideLoadingMask();
... ...
... ... @@ -47,6 +47,7 @@ $basicBtnC:#eb0313;
}
&.table {
.js-wraper {
@include flexbox((
display: box,
box-lines: multiple,
... ... @@ -57,6 +58,7 @@ $basicBtnC:#eb0313;
flex-wrap: wrap,
justify-content: flex-start
));
}
width: 100%;
.column {
box-sizing: border-box;
... ... @@ -91,6 +93,7 @@ $basicBtnC:#eb0313;
white-space:nowrap;
overflow:hidden;
}
}
}
}
... ...