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
24e3a8b8
Commit
24e3a8b8
authored
Nov 18, 2013
by
Michael Rotoloni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit test for removing only active class from within the scroll spy key.
parent
9f30f557
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
js/tests/unit/scrollspy.js
js/tests/unit/scrollspy.js
+37
-0
No files found.
js/tests/unit/scrollspy.js
View file @
24e3a8b8
...
...
@@ -34,4 +34,41 @@ $(function () {
ok
(
$topbar
.
find
(
'
.active
'
,
true
))
})
test
(
"
should only switch active class on current target
"
,
function
()
{
var
sectionHTML
=
'
<div id="root" class="active">
'
+
'
<div class="topbar">
'
+
'
<div class="topbar-inner">
'
+
'
<div class="container" id="ss-target">
'
+
'
<ul class="nav">
'
+
'
<li><a href="#masthead">Overview</a></li>
'
+
'
<li><a href="#detail">Detail</a></li>
'
+
'
</ul>
'
+
'
</div>
'
+
'
</div>
'
+
'
</div>
'
+
'
<div id="scrollspy-example" style="height: 100px; overflow: auto;">
'
+
'
<div style="height: 200px;">
'
+
'
<h4 id="masthead">Overview</h4>
'
+
'
<p style="height: 200px">
'
+
'
Ad leggings keytar, brunch id art party dolor labore.
'
+
'
</p>
'
+
'
</div>
'
+
'
<div style="height: 200px;">
'
+
'
<h4 id="detail">Detail</h4>
'
+
'
<p style="height: 200px">
'
+
'
Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.
'
+
'
</p>
'
+
'
</div>
'
+
'
</div>
'
+
'
</div>
'
,
$section
=
$
(
sectionHTML
).
appendTo
(
"
#qunit-fixture
"
)
,
$scrollSpy
=
$section
.
show
()
.
find
(
"
#scrollspy-example
"
)
.
scrollspy
({
target
:
"
#ss-target
"
})
$scrollSpy
.
scrollTop
(
350
);
ok
(
$section
.
hasClass
(
"
active
"
),
"
Active class still on root node
"
)
})
})
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