Browse Source

fixed on click event for paginationVAlign 'both'

Dustin Utecht 6 years ago
parent
commit
76d5cc9e35

+ 1 - 1
src/constants/index.js

@@ -4,7 +4,7 @@ let bootstrapVersion = 4
 try {
   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).
   if (rawVersion !== undefined) {
     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)
 
     if (this.options.showJumpTo) {
-      const that = this
       const $pageGroup = this.$pagination.find('> .pagination')
       let $jumpTo = $pageGroup.find('.page-jump-to')
 
@@ -35,8 +34,8 @@ $.BootstrapTable = class extends $.BootstrapTable {
           </div>
         `).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())
         })
       }
     }