浏览代码

Merge pull request #4383 from wenzhixin/fix/4352

Fixed on click event for paginationVAlign 'both'
文翼 6 年之前
父节点
当前提交
21a16a5d99
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 1 1
      src/constants/index.js
  2. 2 3
      src/extensions/page-jump-to/bootstrap-table-page-jump-to.js

+ 1 - 1
src/constants/index.js

@@ -4,7 +4,7 @@ let bootstrapVersion = 4
 try {
 try {
   const rawVersion = $.fn.dropdown.Constructor.VERSION
   const rawVersion = $.fn.dropdown.Constructor.VERSION
 
 
-  // Only try to parse VERSION if is is defined.
+  // Only try to parse VERSION if it is defined.
   // It is undefined in older versions of Bootstrap (tested with 3.1.1).
   // It is undefined in older versions of Bootstrap (tested with 3.1.1).
   if (rawVersion !== undefined) {
   if (rawVersion !== undefined) {
     bootstrapVersion = parseInt(rawVersion, 10)
     bootstrapVersion = parseInt(rawVersion, 10)

+ 2 - 3
src/extensions/page-jump-to/bootstrap-table-page-jump-to.js

@@ -21,7 +21,6 @@ $.BootstrapTable = class extends $.BootstrapTable {
     super.initPagination(...args)
     super.initPagination(...args)
 
 
     if (this.options.showJumpTo) {
     if (this.options.showJumpTo) {
-      const that = this
       const $pageGroup = this.$pagination.find('> .pagination')
       const $pageGroup = this.$pagination.find('> .pagination')
       let $jumpTo = $pageGroup.find('.page-jump-to')
       let $jumpTo = $pageGroup.find('.page-jump-to')
 
 
@@ -35,8 +34,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
           </div>
           </div>
         `).appendTo($pageGroup)
         `).appendTo($pageGroup)
 
 
-        $jumpTo.find('button').click(() => {
-          this.selectPage(+$jumpTo.find('input').val())
+        $jumpTo.on('click', 'button', (e) => {
+          this.selectPage(+$(e.target).parent('.page-jump-to').find('input').val())
         })
         })
       }
       }
     }
     }