浏览代码

fix #3628: Fixed smartDisplay option pagination bug.

zhixin 6 年之前
父节点
当前提交
5dbbe8dc97
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      src/bootstrap-table.js

+ 7 - 6
src/bootstrap-table.js

@@ -1625,18 +1625,19 @@
         $next = this.$pagination.find('.page-next')
         $number = this.$pagination.find('.page-item').not('.page-next, .page-pre')
 
+        if (this.totalPages <= 1) {
+          this.$pagination.find('div.pagination').hide()
+        }
+
         if (o.smartDisplay) {
-          if (this.totalPages <= 1) {
-            this.$pagination.find('div.pagination').hide()
-          }
           if (pageList.length < 2 || o.totalRows <= pageList[0]) {
             this.$pagination.find('span.page-list').hide()
           }
-
-          // when data is empty, hide the pagination
-          this.$pagination[this.getData().length ? 'show' : 'hide']()
         }
 
+        // when data is empty, hide the pagination
+        this.$pagination[this.getData().length ? 'show' : 'hide']()
+
         if (!o.paginationLoop) {
           if (o.pageNumber === 1) {
             $pre.addClass('disabled')