mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-12 08:34:08 +02:00
Add horizontal collapse support
This commit is contained in:
@@ -50,6 +50,7 @@ const CLASS_NAME_SHOW = 'show'
|
||||
const CLASS_NAME_COLLAPSE = 'collapse'
|
||||
const CLASS_NAME_COLLAPSING = 'collapsing'
|
||||
const CLASS_NAME_COLLAPSED = 'collapsed'
|
||||
const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'
|
||||
|
||||
const WIDTH = 'width'
|
||||
const HEIGHT = 'height'
|
||||
@@ -266,7 +267,7 @@ class Collapse extends BaseComponent {
|
||||
}
|
||||
|
||||
_getDimension() {
|
||||
return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT
|
||||
return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT
|
||||
}
|
||||
|
||||
_getParent() {
|
||||
|
@@ -225,7 +225,7 @@ describe('Collapse', () => {
|
||||
})
|
||||
|
||||
it('should show a collapsed element on width', done => {
|
||||
fixtureEl.innerHTML = '<div class="collapse width" style="width: 0px;"></div>'
|
||||
fixtureEl.innerHTML = '<div class="collapse collapse-horizontal" style="width: 0px;"></div>'
|
||||
|
||||
const collapseEl = fixtureEl.querySelector('div')
|
||||
const collapse = new Collapse(collapseEl, {
|
||||
|
Reference in New Issue
Block a user