Skip to content

Commit

Permalink
Don't assume option is always a string, closes #2896
Browse files Browse the repository at this point in the history
Fixes a Bootstrap bug introduced by twbs/bootstrap#16011
  • Loading branch information
cpsievert committed May 15, 2020
1 parent 0581dc7 commit 9a9686e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inst/www/shared/bootstrap/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ if (typeof jQuery === 'undefined') {
var data = $this.data('bs.collapse')
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)

if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
if (!data && options.toggle && typeof option === 'string' && /show|hide/.test(option)) options.toggle = false
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
Expand Down
Loading

0 comments on commit 9a9686e

Please sign in to comment.