...
|
...
|
@@ -16,8 +16,17 @@ var $searchBox = $('.search-box'), |
|
|
$appFloatLayer = $('#float-layer-app');
|
|
|
|
|
|
var $search = $searchBox.children('input[type="text"]'),
|
|
|
$cancelSearch = $box.children('.no-search'),
|
|
|
$searchIcon = $searchBox.children('.search-icon');
|
|
|
$cancelSearch = $box.children('.no-search'),
|
|
|
$searchIcon = $searchBox.children('.search-icon');
|
|
|
|
|
|
// variables for calculate the app download layer position
|
|
|
var layerInit = false,
|
|
|
windowViewHeight = 0,
|
|
|
layerContentHeight = $appFloatLayer.height(),
|
|
|
layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),
|
|
|
layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),
|
|
|
layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,
|
|
|
layerNewPos;
|
|
|
|
|
|
require('../common');
|
|
|
|
...
|
...
|
@@ -45,15 +54,7 @@ $searchBox.children('.clear-text').on('touchstart', function() { |
|
|
|
|
|
$searchBox.children('.search-icon').on('touchstart', function() {
|
|
|
if (security.hasDangerInput()) {
|
|
|
<<<<<<< HEAD
|
|
|
<<<<<<< HEAD
|
|
|
return false;
|
|
|
=======
|
|
|
return false;
|
|
|
>>>>>>> 3685878e28b5f0a7fbf2ebdb250a96a5ecc47f52
|
|
|
=======
|
|
|
return false;
|
|
|
>>>>>>> 70676b75c6237c141c6f2f4e47518bcd80ea47d8
|
|
|
}
|
|
|
$indexSearch.submit();
|
|
|
});
|
...
|
...
|
@@ -80,32 +81,40 @@ $channelLink.on('touchstart', function() { |
|
|
borderColor: '#fff'
|
|
|
});
|
|
|
});
|
|
|
var updateLayerPosition = (function() {
|
|
|
var init = false;
|
|
|
return function() {
|
|
|
var winHeight = window.innerHeight;
|
|
|
var bodyHeight = $doc.height();
|
|
|
var scrollTopPosition = $win.scrollTop();
|
|
|
var layerHeight = $appFloatLayer.height();
|
|
|
var layerPaddingTop = parseInt($appFloatLayer.css('padding-top'));
|
|
|
var layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom'));
|
|
|
var newPosition;
|
|
|
if(init){
|
|
|
newPosition = bodyHeight - winHeight- scrollTopPosition;
|
|
|
}else{
|
|
|
init = true;
|
|
|
newPosition = bodyHeight - winHeight - scrollTopPosition + layerHeight + layerPaddingTop + layerPaddingBottom;
|
|
|
}
|
|
|
$appFloatLayer.css({
|
|
|
'position': 'relative',
|
|
|
'bottom': newPosition + 'px'
|
|
|
});
|
|
|
};
|
|
|
})();
|
|
|
|
|
|
$win.scroll(function() {
|
|
|
updateLayerPosition();
|
|
|
});
|
|
|
|
|
|
|
|
|
function updateLayerPosition() {
|
|
|
var winHeight = window.innerHeight,
|
|
|
bodyHeight = $doc.height(),
|
|
|
scrollTopPosition = $win.scrollTop();
|
|
|
|
|
|
if (layerInit) {
|
|
|
|
|
|
//keyboard is shown
|
|
|
if (windowViewHeight - winHeight > 200) {
|
|
|
if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {
|
|
|
layerNewPos = 0;
|
|
|
} else {
|
|
|
layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;
|
|
|
}
|
|
|
} else {
|
|
|
layerNewPos = bodyHeight - winHeight - scrollTopPosition;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
windowViewHeight = winHeight;
|
|
|
layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;
|
|
|
layerInit = true;
|
|
|
}
|
|
|
|
|
|
$appFloatLayer.css({
|
|
|
position: 'relative',
|
|
|
bottom: layerNewPos + 'px'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$(window).scroll(function() {
|
|
|
window.requestAnimationFrame(updateLayerPosition);
|
|
|
});
|
|
|
|
|
|
$doc.on('ready', updateLayerPosition); |
...
|
...
|
|