Authored by xuqi

repos footer in list

@@ -5,6 +5,10 @@ @@ -5,6 +5,10 @@
5 */ 5 */
6 var $ = require('jquery'); 6 var $ = require('jquery');
7 7
  8 +var $footer = $('#yoho-footer');
  9 +
  10 +var FOOTERHEIGHT = 120; //footer height
  11 +
8 function cookie(name) { 12 function cookie(name) {
9 var cookies = document.cookie, 13 var cookies = document.cookie,
10 cookieVal, 14 cookieVal,
@@ -90,14 +94,26 @@ function getShoppingKey() { @@ -90,14 +94,26 @@ function getShoppingKey() {
90 return JSON.parse(c).k; 94 return JSON.parse(c).k;
91 } 95 }
92 96
  97 +//根据页面内容重新设置通用底部的显示
  98 +function rePosFooter() {
  99 + if ($footer.length === 0) {
  100 + return;
  101 + }
  102 +
  103 + if ($('body').height() < $(window).height() - FOOTERHEIGHT) {
  104 + $footer.addClass('bottom');
  105 + } else {
  106 + $footer.removeClass('bottom');
  107 + }
  108 +}
  109 +
93 //页面通用底部位置及status设置 110 //页面通用底部位置及status设置
94 (function () { 111 (function () {
95 - var $footer = $('#yoho-footer'),  
96 - $op = $footer.children('.op-row'); 112 + var $op = $footer.children('.op-row');
97 113
98 var user = getUser(); 114 var user = getUser();
99 115
100 - if ($('body').height() < $(window).height()) { 116 + if ($('body').height() < $(window).height() - FOOTERHEIGHT) {
101 $footer.addClass('bottom'); 117 $footer.addClass('bottom');
102 } 118 }
103 119
@@ -132,3 +148,5 @@ window.getUser = getUser; @@ -132,3 +148,5 @@ window.getUser = getUser;
132 window.getUid = getUid; 148 window.getUid = getUid;
133 149
134 window.getShoppingKey = getShoppingKey; 150 window.getShoppingKey = getShoppingKey;
  151 +
  152 +window.rePosFooter = rePosFooter;
@@ -213,6 +213,8 @@ function search(opt) { @@ -213,6 +213,8 @@ function search(opt) {
213 213
214 searching = false; 214 searching = false;
215 loading.hideLoadingMask(); 215 loading.hideLoadingMask();
  216 +
  217 + window.rePosFooter();
216 } 218 }
217 }); 219 });
218 220
@@ -218,6 +218,8 @@ function search(opt) { @@ -218,6 +218,8 @@ function search(opt) {
218 218
219 searching = false; 219 searching = false;
220 loading.hideLoadingMask(); 220 loading.hideLoadingMask();
  221 +
  222 + window.rePosFooter();
221 } 223 }
222 }); 224 });
223 225
@@ -244,6 +244,8 @@ function search(opt) { @@ -244,6 +244,8 @@ function search(opt) {
244 244
245 searching = false; 245 searching = false;
246 loading.hideLoadingMask(); 246 loading.hideLoadingMask();
  247 +
  248 + window.rePosFooter();
247 } 249 }
248 }); 250 });
249 251