提交 8f4a186b 编写于 作者: 街头小贩's avatar 街头小贩

修正动态分页错误

上级 826ba1f1
......@@ -44,26 +44,24 @@ define('jForum', [
var extEle = $('#page_another_navigation');
extEle.find(pnSelector).remove();
extEle.append(pageHtmlStruct);
}
};
paginationFunction(_pn, option).done(function (jsonArray) {
if (jQuery.isEmptyObject(jsonArray)) {
},
jsonCallback: function (jsonArray) {
if ($.isEmptyObject(jsonArray)) {
return;
}
var jsonCallFun = template[rawdata.callFun];
if (typeof jsonCallFun === "function") {
jsonCallFun.call(this, jsonArray);
} else {
console.log('[page_navigation]json callback function:' + jsonCallFun + ' is not function or jForumXhrDefer not module');
var fn = template[rawdata.callFun];
if (typeof fn === "function") {
fn.call(this, jsonArray);
}
}).done(function () {
},
deferCallback: function(){
var deferFun = xhrDefer[rawdata.defFun];
if (typeof deferFun === "function") {
deferFun.call(this, xhr, template);
} else {
console.log('[page_navigation]defer callback function:' + deferFun + ' is not function or jForumXhrDefer not module');
}
}).fail(function () {
}
};
paginationFunction(_pn, option).fail(function () {
console.log('[page_navigation] execute fail');
});
}).trigger('initDataEvent');
......
......@@ -63,6 +63,9 @@ define('jForumPagination', [
// a=总页数
var b = _curIns._calc(response.page, a);
_curIns.render(b.start, b.end, response.page, a, jqEle);
if ($.isFunction(_curIns.config.jsonCallback)) {
_curIns.config.jsonCallback(response.result);
}
//滚动到顶部
$('html, body').animate({ scrollTop: 0 }, 500);
_curIns.defer.resolve(response.result);
......@@ -84,6 +87,9 @@ define('jForumPagination', [
}
//记入历史
recordHistory(page, postData.pageSize);
if ($.isFunction(_curIns.config.deferCallback)) {
_curIns.config.deferCallback();
}
console.log('[pagination] ajax is complete');
};
$.ajax(formatAjaxParams);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册