Browse Source

Support buttons.xyz.attributes.class

Marcel Overdijk 2 years ago
parent
commit
5c86f2f3f7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/bootstrap-table.js

+ 3 - 3
src/bootstrap-table.js

@@ -746,10 +746,10 @@ class BootstrapTable {
           buttonHtml = buttonConfig.html
         }
       } else {
-        if (buttonConfig.hasOwnProperty('attributes')) {
-          let buttonClass = buttonConfig.attributes.class || ''
+        let buttonClass = this.constants.buttonsClass
+        if (buttonConfig.hasOwnProperty('attributes') && buttonConfig.attributes.class) {
+          buttonClass += ` ${buttonConfig.attributes.class}`
         }
-        buttonClass += ` ${this.constants.buttonsClass}`
         buttonHtml = `<button class="${buttonClass}" type="button" name="${buttonName}"`
 
         if (buttonConfig.hasOwnProperty('attributes')) {