Skip to content

Commit

Permalink
Added support for setting icons automatically by iconsPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin committed Feb 20, 2024
1 parent 89aada0 commit dd0e9d3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/bootstrap-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ class BootstrapTable {

// init iconsPrefix and icons
const iconsPrefix = Utils.getIconsPrefix($.fn.bootstrapTable.theme)
const icons = Utils.getIcons(iconsPrefix)

if (typeof opts.icons === 'string') {
opts.icons = Utils.calculateObjectValue(null, opts.icons)
}

opts.iconsPrefix = opts.iconsPrefix || $.fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix
opts.icons = Object.assign(icons, $.fn.bootstrapTable.defaults.icons, opts.icons)
opts.icons = Object.assign(Utils.getIcons(opts.iconsPrefix), $.fn.bootstrapTable.defaults.icons, opts.icons)

// init buttons class
const buttonsPrefix = opts.buttonsPrefix ? `${opts.buttonsPrefix}-` : ''
Expand Down Expand Up @@ -957,9 +956,7 @@ class BootstrapTable {
})
}
} else if (typeof opts.searchSelector === 'string') {
const $searchInput = Utils.getSearchInput(this)

handleInputEvent($searchInput)
handleInputEvent(Utils.getSearchInput(this))
}
}

Expand Down

0 comments on commit dd0e9d3

Please sign in to comment.