Authored by xuqi

amend the error when there is no maybe-like module

... ... @@ -8,12 +8,22 @@ var $ = require('jquery'),
Mustache = require('mustache'),
lazyLoad = require('./lazyload');
var $maybeLike = $('.maybe-like:last');
// 无可能喜欢模块时直接返回
if ($maybeLike.length === 0) {
return;
}
var winH = $(window).height(),
loading = false,
end = false,
page = 1,
tpl;
var $goodList = $maybeLike.children('.goods-list'),
mblTop = $maybeLike.offset().top; //页面内容固定,可以预先求出高度
//read good-info template
$.get('/common/goodinfo', function(data) {
tpl = '{{# goods}}' + data + '{{/ goods}}';
... ... @@ -54,9 +64,6 @@ $('.goods-list').delegate('.good-islike', 'touchstart', function(e) {
}
});
var $maybeLike = $('.maybe-like:last'),
$goodList = $maybeLike.children('.goods-list'),
mblTop = $maybeLike.offset().top; //页面内容固定,可以预先求出高度
//srcoll to load more
$(window).scroll(function() {
... ...