@@ -33,41 +33,40 @@ $(function () {
3333 ok ( $topbar . find ( '.active' , true ) )
3434 } )
3535
36- test ( "should only switch active class on current target" , function ( ) {
37- var
38- sectionHTML = '<div id="root" class="active">'
39- + '<div class="topbar">'
40- + '<div class="topbar-inner">'
41- + '<div class="container" id="ss-target">'
42- + '<ul class="nav">'
43- + '<li><a href="#masthead">Overview</a></li>'
44- + '<li><a href="#detail">Detail</a></li>'
45- + '</ul>'
46- + '</div>'
47- + '</div>'
48- + '</div>'
49- + '<div id="scrollspy-example" style="height: 100px; overflow: auto;">'
50- + '<div style="height: 200px;">'
51- + '<h4 id="masthead">Overview</h4>'
52- + '<p style="height: 200px">'
53- + 'Ad leggings keytar, brunch id art party dolor labore.'
54- + '</p>'
55- + '</div>'
56- + '<div style="height: 200px;">'
57- + '<h4 id="detail">Detail</h4>'
58- + '<p style="height: 200px">'
59- + 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.'
60- + '</p>'
61- + '</div>'
62- + '</div>'
63- + '</div>'
64- , $section = $ ( sectionHTML ) . appendTo ( "#qunit-fixture" )
65- , $scrollSpy = $section
66- . show ( )
67- . find ( "#scrollspy-example" )
68- . scrollspy ( { target : "#ss-target" } )
36+ test ( 'should only switch active class on current target' , function ( ) {
37+ var sectionHTML = '<div id="root" class="active">' +
38+ '<div class="topbar">' +
39+ '<div class="topbar-inner">' +
40+ '<div class="container" id="ss-target">' +
41+ '<ul class="nav">' +
42+ '<li><a href="#masthead">Overview</a></li>' +
43+ '<li><a href="#detail">Detail</a></li>' +
44+ '</ul>' +
45+ '</div>' +
46+ '</div>' +
47+ '</div>' +
48+ '<div id="scrollspy-example" style="height: 100px; overflow: auto;">' +
49+ '<div style="height: 200px;">' +
50+ '<h4 id="masthead">Overview</h4>' +
51+ '<p style="height: 200px">' +
52+ 'Ad leggings keytar, brunch id art party dolor labore.' +
53+ '</p>' +
54+ '</div>' +
55+ '<div style="height: 200px;">' +
56+ '<h4 id="detail">Detail</h4>' +
57+ '<p style="height: 200px">' +
58+ 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.' +
59+ '</p>' +
60+ '</div>' +
61+ '</div>' +
62+ '</div>' ,
63+ $section = $ ( sectionHTML ) . appendTo ( '#qunit-fixture' ) ,
64+ $scrollSpy = $section
65+ . show ( )
66+ . find ( '#scrollspy-example' )
67+ . scrollspy ( { target : '#ss-target' } )
6968
70- $scrollSpy . scrollTop ( 350 ) ;
71- ok ( $section . hasClass ( " active" ) , " Active class still on root node" )
72- } )
69+ $scrollSpy . scrollTop ( 350 ) ;
70+ ok ( $section . hasClass ( ' active' ) , ' Active class still on root node' )
71+ } )
7372} )
0 commit comments