ソースを参照

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) {
             if (this.options.pageNumber <= 1) {
                 $first.addClass('disabled');
                 $first.addClass('disabled');
                 $pre.addClass('disabled');
                 $pre.addClass('disabled');
+            } else {
+                $first.attr('title', 1);
+                $pre.attr('title', (this.options.pageNumber - 1));
             }
             }
             if (this.options.pageNumber >= this.totalPages) {
             if (this.options.pageNumber >= this.totalPages) {
                 $next.addClass('disabled');
                 $next.addClass('disabled');
                 $last.addClass('disabled');
                 $last.addClass('disabled');
+            } else {
+                $next.attr('title', (this.options.pageNumber + 1));
+                $last.attr('title', this.totalPages);
             }
             }
             if (this.options.smartDisplay) {
             if (this.options.smartDisplay) {
                 if (this.totalPages <= 1) {
                 if (this.totalPages <= 1) {