Browse Source

Fixed event binding if only one export type is set (#5942)

Co-authored-by: Dennis Hernández <dennishernandezvargas@gmail.com>
Dustin Utecht 4 years ago
parent
commit
cab32d1b5b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/extensions/export/bootstrap-table-export.js

+ 7 - 1
src/extensions/export/bootstrap-table-export.js

@@ -149,7 +149,13 @@ $.BootstrapTable = class extends $.BootstrapTable {
     }
 
     this.updateExportButton()
-    this.$export.find('[data-type]').click(e => {
+    let $exportButtons = this.$export.find('[data-type]')
+
+    if (exportTypes.length === 1) {
+      $exportButtons = this.$export.find('button')
+    }
+
+    $exportButtons.click(e => {
       e.preventDefault()
 
       const type = $(e.currentTarget).data('type')