浏览代码

Merge pull request #1620 from u01jmg3/add-titles-to-pagination

Add `title` attribute to pagination controls defining the page number the control option will take you to
wenzhixin 10 年之前
父节点
当前提交
95f83762e0
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/bootstrap-table.js

+ 6 - 0
src/bootstrap-table.js

@@ -1286,10 +1286,16 @@
             if (this.options.pageNumber <= 1) {
                 $first.addClass('disabled');
                 $pre.addClass('disabled');
+            } else {
+                $first.attr('title', 1);
+                $pre.attr('title', (this.options.pageNumber - 1));
             }
             if (this.options.pageNumber >= this.totalPages) {
                 $next.addClass('disabled');
                 $last.addClass('disabled');
+            } else {
+                $next.attr('title', (this.options.pageNumber + 1));
+                $last.attr('title', this.totalPages);
             }
             if (this.options.smartDisplay) {
                 if (this.totalPages <= 1) {