Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
9c2e54bf
Commit
9c2e54bf
authored
Aug 18, 2014
by
fat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #14282 - Already Visible collapse gets closed when .collapse('show') is called
parent
ea0e1606
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
js/collapse.js
js/collapse.js
+1
-1
js/tests/unit/collapse.js
js/tests/unit/collapse.js
+32
-0
No files found.
js/collapse.js
View file @
9c2e54bf
...
@@ -124,7 +124,7 @@
...
@@ -124,7 +124,7 @@
var
data
=
$this
.
data
(
'
bs.collapse
'
)
var
data
=
$this
.
data
(
'
bs.collapse
'
)
var
options
=
$
.
extend
({},
Collapse
.
DEFAULTS
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
var
options
=
$
.
extend
({},
Collapse
.
DEFAULTS
,
$this
.
data
(),
typeof
option
==
'
object
'
&&
option
)
if
(
!
data
&&
options
.
toggle
&&
option
==
'
show
'
)
option
=
!
option
if
(
!
data
&&
options
.
toggle
&&
option
==
'
show
'
)
option
s
.
toggle
=
false
if
(
!
data
)
$this
.
data
(
'
bs.collapse
'
,
(
data
=
new
Collapse
(
this
,
options
)))
if
(
!
data
)
$this
.
data
(
'
bs.collapse
'
,
(
data
=
new
Collapse
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
})
...
...
js/tests/unit/collapse.js
View file @
9c2e54bf
...
@@ -102,6 +102,38 @@ $(function () {
...
@@ -102,6 +102,38 @@ $(function () {
$target
.
click
()
$target
.
click
()
})
})
test
(
'
should not close a collapse when initialized with "show" if already shown
'
,
function
()
{
stop
()
expect
(
0
)
var
$test
=
$
(
'
<div id="test1" class="in"/>
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
hide.bs.collapse
'
,
function
()
{
ok
(
false
)
})
$test
.
bootstrapCollapse
(
'
show
'
)
setTimeout
(
start
,
0
)
})
test
(
'
should open a collapse when initialized with "show" if not already shown
'
,
function
()
{
stop
()
expect
(
1
)
var
$test
=
$
(
'
<div id="test1" />
'
)
.
appendTo
(
'
#qunit-fixture
'
)
.
on
(
'
show.bs.collapse
'
,
function
()
{
ok
(
true
)
})
$test
.
bootstrapCollapse
(
'
show
'
)
setTimeout
(
start
,
0
)
})
test
(
'
should remove "collapsed" class from active accordion target
'
,
function
()
{
test
(
'
should remove "collapsed" class from active accordion target
'
,
function
()
{
stop
()
stop
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment