Commit 3d8c8767 authored by Van's avatar Van

🐛 fix #10

parent 71498192
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.6.0.5, Aug 6, 2019 * @version 1.6.1.0, Dec 15, 2019
*/ */
admin.article = { admin.article = {
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。 // 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
...@@ -48,7 +48,7 @@ admin.article = { ...@@ -48,7 +48,7 @@ admin.article = {
$('#tipMsg').text('') $('#tipMsg').text('')
$.ajax({ $.ajax({
url: Label.servePath + '/console/article/' + url: Label.servePath + '/console/article/' +
admin.article.status.id, admin.article.status.id,
type: 'GET', type: 'GET',
cache: false, cache: false,
success: function (result, textStatus) { success: function (result, textStatus) {
...@@ -121,7 +121,15 @@ admin.article = { ...@@ -121,7 +121,15 @@ admin.article = {
return return
} }
admin[fromId + 'List'].getList(1) if (document.querySelectorAll('tr').length === 2) {
const refreshPage = Math.max(
(admin[fromId + 'List'].tablePagination.currentPage - 1), 1)
admin[fromId + 'List'].getList(refreshPage)
admin.setHashByPage(refreshPage)
} else {
admin[fromId + 'List'].getList(
admin[fromId + 'List'].tablePagination.currentPage)
}
}, },
}) })
} }
...@@ -419,7 +427,7 @@ admin.article = { ...@@ -419,7 +427,7 @@ admin.article = {
fun: fun, fun: fun,
previewMode: 'both', previewMode: 'both',
resize: false, resize: false,
typewriterMode: true typewriterMode: true,
}) })
admin.editors.abstractEditor = new SoloEditor({ admin.editors.abstractEditor = new SoloEditor({
...@@ -473,7 +481,7 @@ admin.article = { ...@@ -473,7 +481,7 @@ admin.article = {
that._addDisabled() that._addDisabled()
$.ajax({ $.ajax({
url: Label.servePath + '/console/article/unpublish/' + url: Label.servePath + '/console/article/unpublish/' +
admin.article.status.id, admin.article.status.id,
type: 'PUT', type: 'PUT',
cache: false, cache: false,
success: function (result, textStatus) { success: function (result, textStatus) {
......
...@@ -43,9 +43,7 @@ $.extend(TablePaginate.prototype, { ...@@ -43,9 +43,7 @@ $.extend(TablePaginate.prototype, {
} }
} }
$("#" + this.id + "Table").table(tableData); $("#" + this.id + "Table").table(tableData);
}, },
/* /*
* 初始化分页 * 初始化分页
*/ */
...@@ -84,7 +82,7 @@ $.extend(TablePaginate.prototype, { ...@@ -84,7 +82,7 @@ $.extend(TablePaginate.prototype, {
} }
}); });
}, },
/* /*
* 更新 table & paginateion * 更新 table & paginateion
*/ */
...@@ -101,11 +99,11 @@ $.extend(TablePaginate.prototype, { ...@@ -101,11 +99,11 @@ $.extend(TablePaginate.prototype, {
groupData: data groupData: data
}] }]
}); });
if (pageInfo.paginationPageCount === 0) { if (pageInfo.paginationPageCount === 0) {
pageInfo.paginationPageCount = 1; pageInfo.paginationPageCount = 1;
} }
$("#" + this.id + "Pagination").paginate("update", { $("#" + this.id + "Pagination").paginate("update", {
pageCount: pageInfo.paginationPageCount, pageCount: pageInfo.paginationPageCount,
currentPage: currentPage, currentPage: currentPage,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment