0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-22 19:54:22 +01:00

Move to leading pluses

This commit is contained in:
Heinrich Fenkart 2014-07-06 11:56:12 +02:00
parent dad56be96c
commit 58eb8b2ae3
9 changed files with 421 additions and 421 deletions

View File

@ -38,13 +38,13 @@ $(function () {
test('should trigger affixed event after affix', function () { test('should trigger affixed event after affix', function () {
stop() stop()
var templateHTML = '<div id="affixTarget">' + var templateHTML = '<div id="affixTarget">'
'<ul>' + + '<ul>'
'<li>Please affix</li>' + + '<li>Please affix</li>'
'<li>And unaffix</li>' + + '<li>And unaffix</li>'
'</ul>' + + '</ul>'
'</div>' + + '</div>'
'<div id="affixAfter" style="height: 20000px; display: block;"/>' + '<div id="affixAfter" style="height: 20000px; display: block;"/>'
$(templateHTML).appendTo(document.body) $(templateHTML).appendTo(document.body)
$('#affixTarget').bootstrapAffix({ $('#affixTarget').bootstrapAffix({

View File

@ -30,10 +30,10 @@ $(function () {
}) })
test('should fade element out on clicking .close', function () { test('should fade element out on clicking .close', function () {
var alertHTML = '<div class="alert-message warning fade in">' + var alertHTML = '<div class="alert-message warning fade in">'
'<a class="close" href="#" data-dismiss="alert">×</a>' + + '<a class="close" href="#" data-dismiss="alert">×</a>'
'<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
'</div>' + '</div>'
var $alert = $(alertHTML).bootstrapAlert() var $alert = $(alertHTML).bootstrapAlert()
$alert.find('.close').click() $alert.find('.close').click()
@ -42,10 +42,10 @@ $(function () {
}) })
test('should remove element when clicking .close', function () { test('should remove element when clicking .close', function () {
var alertHTML = '<div class="alert-message warning fade in">' + var alertHTML = '<div class="alert-message warning fade in">'
'<a class="close" href="#" data-dismiss="alert">×</a>' + + '<a class="close" href="#" data-dismiss="alert">×</a>'
'<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
'</div>' + '</div>'
var $alert = $(alertHTML).appendTo('#qunit-fixture').bootstrapAlert() var $alert = $(alertHTML).appendTo('#qunit-fixture').bootstrapAlert()
notEqual($('#qunit-fixture').find('.alert-message').length, 0, 'element added to dom') notEqual($('#qunit-fixture').find('.alert-message').length, 0, 'element added to dom')

View File

@ -115,17 +115,17 @@ $(function () {
}) })
test('should check for closest matching toggle', function () { test('should check for closest matching toggle', function () {
var groupHTML = '<div class="btn-group" data-toggle="buttons">' + var groupHTML = '<div class="btn-group" data-toggle="buttons">'
'<label class="btn btn-primary active">' + + '<label class="btn btn-primary active">'
'<input type="radio" name="options" id="option1" checked="true"> Option 1' + + '<input type="radio" name="options" id="option1" checked="true"> Option 1'
'</label>' + + '</label>'
'<label class="btn btn-primary">' + + '<label class="btn btn-primary">'
'<input type="radio" name="options" id="option2"> Option 2' + + '<input type="radio" name="options" id="option2"> Option 2'
'</label>' + + '</label>'
'<label class="btn btn-primary">' + + '<label class="btn btn-primary">'
'<input type="radio" name="options" id="option3"> Option 3' + + '<input type="radio" name="options" id="option3"> Option 3'
'</label>' + + '</label>'
'</div>' + '</div>'
var $group = $(groupHTML).appendTo('#qunit-fixture') var $group = $(groupHTML).appendTo('#qunit-fixture')
var $btn1 = $group.children().eq(0) var $btn1 = $group.children().eq(0)

View File

@ -44,26 +44,26 @@ $(function () {
}) })
test('should reset when slide is prevented', function () { test('should reset when slide is prevented', function () {
var carouselHTML = '<div id="carousel-example-generic" class="carousel slide">' + var carouselHTML = '<div id="carousel-example-generic" class="carousel slide">'
'<ol class="carousel-indicators">' + + '<ol class="carousel-indicators">'
'<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="0" class="active"/>'
'<li data-target="#carousel-example-generic" data-slide-to="1"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="1"/>'
'<li data-target="#carousel-example-generic" data-slide-to="2"/>' + + '<li data-target="#carousel-example-generic" data-slide-to="2"/>'
'</ol>' + + '</ol>'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<div class="carousel-caption"/>' + + '<div class="carousel-caption"/>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<div class="carousel-caption"/>' + + '<div class="carousel-caption"/>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<div class="carousel-caption"/>' + + '<div class="carousel-caption"/>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>' + + '<a class="left carousel-control" href="#carousel-example-generic" data-slide="prev"/>'
'<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>' + + '<a class="right carousel-control" href="#carousel-example-generic" data-slide="next"/>'
'</div>' + '</div>'
var $carousel = $(carouselHTML) var $carousel = $(carouselHTML)
stop() stop()
@ -89,39 +89,39 @@ $(function () {
}) })
test('should fire slide event with direction', function () { test('should fire slide event with direction', function () {
var carouselHTML = '<div id="myCarousel" class="carousel slide">' + var carouselHTML = '<div id="myCarousel" class="carousel slide">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>First Thumbnail label</h4>' + + '<h4>First Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Second Thumbnail label</h4>' + + '<h4>Second Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Third Thumbnail label</h4>' + + '<h4>Third Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>'
'<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>'
'</div>' + '</div>'
var $carousel = $(carouselHTML) var $carousel = $(carouselHTML)
stop() stop()
@ -143,39 +143,39 @@ $(function () {
}) })
test('should fire slid event with direction', function () { test('should fire slid event with direction', function () {
var carouselHTML = '<div id="myCarousel" class="carousel slide">' + var carouselHTML = '<div id="myCarousel" class="carousel slide">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>First Thumbnail label</h4>' + + '<h4>First Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Second Thumbnail label</h4>' + + '<h4>Second Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Third Thumbnail label</h4>' + + '<h4>Third Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>'
'<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>'
'</div>' + '</div>'
var $carousel = $(carouselHTML) var $carousel = $(carouselHTML)
stop() stop()
@ -197,39 +197,39 @@ $(function () {
}) })
test('should fire slide event with relatedTarget', function () { test('should fire slide event with relatedTarget', function () {
var template = '<div id="myCarousel" class="carousel slide">' + var template = '<div id="myCarousel" class="carousel slide">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>First Thumbnail label</h4>' + + '<h4>First Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Second Thumbnail label</h4>' + + '<h4>Second Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Third Thumbnail label</h4>' + + '<h4>Third Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>'
'<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>'
'</div>' + '</div>'
stop() stop()
@ -243,39 +243,39 @@ $(function () {
}) })
test('should fire slid event with relatedTarget', function () { test('should fire slid event with relatedTarget', function () {
var template = '<div id="myCarousel" class="carousel slide">' + var template = '<div id="myCarousel" class="carousel slide">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>First Thumbnail label</h4>' + + '<h4>First Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Second Thumbnail label</h4>' + + '<h4>Second Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Third Thumbnail label</h4>' + + '<h4>Third Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>'
'<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>'
'</div>' + '</div>'
stop() stop()
@ -289,39 +289,39 @@ $(function () {
}) })
test('should set interval from data attribute', function () { test('should set interval from data attribute', function () {
var templateHTML = '<div id="myCarousel" class="carousel slide">' + var templateHTML = '<div id="myCarousel" class="carousel slide">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>First Thumbnail label</h4>' + + '<h4>First Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Second Thumbnail label</h4>' + + '<h4>Second Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'<div class="carousel-caption">' + + '<div class="carousel-caption">'
'<h4>Third Thumbnail label</h4>' + + '<h4>Third Thumbnail label</h4>'
'<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec ' + + '<p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec '
'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ' + + 'id elit non mi porta gravida at eget metus. Nullam id dolor id nibh '
'ultricies vehicula ut id elit.</p>' + + 'ultricies vehicula ut id elit.</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>' + + '<a class="left carousel-control" href="#myCarousel" data-slide="prev">&lsaquo;</a>'
'<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>' + + '<a class="right carousel-control" href="#myCarousel" data-slide="next">&rsaquo;</a>'
'</div>' + '</div>'
var $carousel = $(templateHTML) var $carousel = $(templateHTML)
$carousel.attr('data-interval', 1814) $carousel.attr('data-interval', 1814)
@ -350,19 +350,19 @@ $(function () {
}) })
test('should skip over non-items', function () { test('should skip over non-items', function () {
var templateHTML = '<div id="myCarousel" class="carousel" data-interval="1814">' + var templateHTML = '<div id="myCarousel" class="carousel" data-interval="1814">'
'<div class="carousel-inner">' + + '<div class="carousel-inner">'
'<div class="item active">' + + '<div class="item active">'
'<img alt="">' + + '<img alt="">'
'</div>' + + '</div>'
'<script type="text/x-metamorph" id="thingy"/>' + + '<script type="text/x-metamorph" id="thingy"/>'
'<div class="item">' + + '<div class="item">'
'<img alt="">' + + '<img alt="">'
'</div>' + + '</div>'
'<div class="item">' + + '<div class="item">'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + '</div>'
var $template = $(templateHTML) var $template = $(templateHTML)
$template.bootstrapCarousel() $template.bootstrapCarousel()

View File

@ -105,11 +105,11 @@ $(function () {
test('should remove "collapsed" class from active accordion target', function () { test('should remove "collapsed" class from active accordion target', function () {
stop() stop()
var accordionHTML = '<div id="accordion">' + var accordionHTML = '<div id="accordion">'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'</div>' + '</div>'
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.accordion-group') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.accordion-group')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
@ -138,11 +138,11 @@ $(function () {
test('should allow dots in data-parent', function () { test('should allow dots in data-parent', function () {
stop() stop()
var accordionHTML = '<div class="accordion">' + var accordionHTML = '<div class="accordion">'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'<div class="accordion-group"/>' + + '<div class="accordion-group"/>'
'</div>' + '</div>'
var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.accordion-group') var $groups = $(accordionHTML).appendTo('#qunit-fixture').find('.accordion-group')
var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0))

View File

@ -30,68 +30,68 @@ $(function () {
}) })
test('should not open dropdown if target is disabled via attribute', function () { test('should not open dropdown if target is disabled via attribute', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<button disabled href="#" class="btn dropdown-toggle" data-toggle="dropdown">Dropdown</button>' + + '<button disabled href="#" class="btn dropdown-toggle" data-toggle="dropdown">Dropdown</button>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click() var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(!$dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click') ok(!$dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click')
}) })
test('should not open dropdown if target is disabled via class', function () { test('should not open dropdown if target is disabled via class', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<button href="#" class="btn dropdown-toggle disabled" data-toggle="dropdown">Dropdown</button>' + + '<button href="#" class="btn dropdown-toggle disabled" data-toggle="dropdown">Dropdown</button>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click() var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(!$dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click') ok(!$dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click')
}) })
test('should add class open to menu if clicked', function () { test('should add class open to menu if clicked', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click() var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok($dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click') ok($dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click')
}) })
test('should test if element has a # before assuming it\'s a selector', function () { test('should test if element has a # before assuming it\'s a selector', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<a href="/foo/" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<a href="/foo/" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click() var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok($dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click') ok($dropdown.parent('.dropdown').hasClass('open'), '"open" class added on click')
@ -99,17 +99,17 @@ $(function () {
test('should remove "open" class if body is clicked', function () { test('should remove "open" class if body is clicked', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML) var $dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
@ -122,22 +122,22 @@ $(function () {
}) })
test('should remove "open" class if body is clicked, with multiple dropdowns', function () { test('should remove "open" class if body is clicked, with multiple dropdowns', function () {
var dropdownHTML = '<ul class="nav">' + var dropdownHTML = '<ul class="nav">'
'<li><a href="#menu1">Menu 1</a></li>' + + '<li><a href="#menu1">Menu 1</a></li>'
'<li class="dropdown" id="testmenu">' + + '<li class="dropdown" id="testmenu">'
'<a class="dropdown-toggle" data-toggle="dropdown" href="#testmenu">Test menu <span class="caret"/></a>' + + '<a class="dropdown-toggle" data-toggle="dropdown" href="#testmenu">Test menu <span class="caret"/></a>'
'<ul class="dropdown-menu" role="menu">' + + '<ul class="dropdown-menu" role="menu">'
'<li><a href="#sub1">Submenu 1</a></li>' + + '<li><a href="#sub1">Submenu 1</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + + '</ul>'
'<div class="btn-group">' + + '<div class="btn-group">'
'<button class="btn">Actions</button>' + + '<button class="btn">Actions</button>'
'<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"/></button>' + + '<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"/></button>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Action 1</a></li>' + + '<li><a href="#">Action 1</a></li>'
'</ul>' + + '</ul>'
'</div>' + '</div>'
var $dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]') var $dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]')
var $first = $dropdowns.first() var $first = $dropdowns.first()
var $last = $dropdowns.last() var $last = $dropdowns.last()
@ -158,17 +158,17 @@ $(function () {
}) })
test('should fire show and hide event', function () { test('should fire show and hide event', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML) var $dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')
@ -192,17 +192,17 @@ $(function () {
test('should fire shown and hidden event', function () { test('should fire shown and hidden event', function () {
var dropdownHTML = '<ul class="tabs">' + var dropdownHTML = '<ul class="tabs">'
'<li class="dropdown">' + + '<li class="dropdown">'
'<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>' + + '<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#">Secondary link</a></li>' + + '<li><a href="#">Secondary link</a></li>'
'<li><a href="#">Something else here</a></li>' + + '<li><a href="#">Something else here</a></li>'
'<li class="divider"/>' + + '<li class="divider"/>'
'<li><a href="#">Another link</a></li>' + + '<li><a href="#">Another link</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
var $dropdown = $(dropdownHTML) var $dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]') .find('[data-toggle="dropdown"]')

View File

@ -31,15 +31,15 @@ $(function () {
// Does not work properly ATM, #13500 will fix this // Does not work properly ATM, #13500 will fix this
test('should switch "active" class on scroll', function () { test('should switch "active" class on scroll', function () {
var topbarHTML = '<div class="topbar">' + var topbarHTML = '<div class="topbar">'
'<div class="topbar-inner">' + + '<div class="topbar-inner">'
'<div class="container">' + + '<div class="container">'
'<h3><a href="#">Bootstrap</a></h3>' + + '<h3><a href="#">Bootstrap</a></h3>'
'<li><a href="#masthead">Overview</a></li>' + + '<li><a href="#masthead">Overview</a></li>'
'</ul>' + + '</ul>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + '</div>'
var $topbar = $(topbarHTML).bootstrapScrollspy() var $topbar = $(topbarHTML).bootstrapScrollspy()
ok($topbar.find('.active', true)) ok($topbar.find('.active', true))
@ -48,32 +48,32 @@ $(function () {
test('should only switch "active" class on current target', function () { test('should only switch "active" class on current target', function () {
stop() stop()
var sectionHTML = '<div id="root" class="active">' + var sectionHTML = '<div id="root" class="active">'
'<div class="topbar">' + + '<div class="topbar">'
'<div class="topbar-inner">' + + '<div class="topbar-inner">'
'<div class="container" id="ss-target">' + + '<div class="container" id="ss-target">'
'<ul class="nav">' + + '<ul class="nav">'
'<li><a href="#masthead">Overview</a></li>' + + '<li><a href="#masthead">Overview</a></li>'
'<li><a href="#detail">Detail</a></li>' + + '<li><a href="#detail">Detail</a></li>'
'</ul>' + + '</ul>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'<div id="scrollspy-example" style="height: 100px; overflow: auto;">' + + '<div id="scrollspy-example" style="height: 100px; overflow: auto;">'
'<div style="height: 200px;">' + + '<div style="height: 200px;">'
'<h4 id="masthead">Overview</h4>' + + '<h4 id="masthead">Overview</h4>'
'<p style="height: 200px">' + + '<p style="height: 200px">'
'Ad leggings keytar, brunch id art party dolor labore.' + + 'Ad leggings keytar, brunch id art party dolor labore.'
'</p>' + + '</p>'
'</div>' + + '</div>'
'<div style="height: 200px;">' + + '<div style="height: 200px;">'
'<h4 id="detail">Detail</h4>' + + '<h4 id="detail">Detail</h4>'
'<p style="height: 200px">' + + '<p style="height: 200px">'
'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.' + + 'Veniam marfa mustache skateboard, adipisicing fugiat velit pitchfork beard.'
'</p>' + + '</p>'
'</div>' + + '</div>'
'</div>' + + '</div>'
'</div>' + '</div>'
var $section = $(sectionHTML).appendTo('#qunit-fixture') var $section = $(sectionHTML).appendTo('#qunit-fixture')
var $scrollspy = $section var $scrollspy = $section
@ -92,19 +92,19 @@ $(function () {
test('middle navigation option correctly selected when large offset is used', function () { test('middle navigation option correctly selected when large offset is used', function () {
stop() stop()
var sectionHTML = '<div id="header" style="height: 500px;"></div>' + var sectionHTML = '<div id="header" style="height: 500px;"></div>'
'<nav id="navigation" class="navbar">' + + '<nav id="navigation" class="navbar">'
'<ul class="nav navbar-nav">' + + '<ul class="nav navbar-nav">'
'<li class="active"><a id="one-link" href="#one">One</a></li>' + + '<li class="active"><a id="one-link" href="#one">One</a></li>'
'<li><a id="two-link" href="#two">Two</a></li>' + + '<li><a id="two-link" href="#two">Two</a></li>'
'<li><a id="three-link" href="#three">Three</a></li>' + + '<li><a id="three-link" href="#three">Three</a></li>'
'</ul>' + + '</ul>'
'</nav>' + + '</nav>'
'<div id="content" style="height: 200px; overflow-y: auto;">' + + '<div id="content" style="height: 200px; overflow-y: auto;">'
'<div id="one" style="height: 500px;"></div>' + + '<div id="one" style="height: 500px;"></div>'
'<div id="two" style="height: 300px;"></div>' + + '<div id="two" style="height: 300px;"></div>'
'<div id="three" style="height: 10px;"></div>' + + '<div id="three" style="height: 10px;"></div>'
'</div>' + '</div>'
var $section = $(sectionHTML).appendTo('#qunit-fixture') var $section = $(sectionHTML).appendTo('#qunit-fixture')
var $scrollspy = $section var $scrollspy = $section
.show() .show()

View File

@ -30,10 +30,10 @@ $(function () {
}) })
test('should activate element by tab id', function () { test('should activate element by tab id', function () {
var tabsHTML = '<ul class="tabs">' + var tabsHTML = '<ul class="tabs">'
'<li><a href="#home">Home</a></li>' + + '<li><a href="#home">Home</a></li>'
'<li><a href="#profile">Profile</a></li>' + + '<li><a href="#profile">Profile</a></li>'
'</ul>' + '</ul>'
$('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture') $('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture')
@ -45,10 +45,10 @@ $(function () {
}) })
test('should activate element by tab id', function () { test('should activate element by tab id', function () {
var pillsHTML = '<ul class="pills">' + var pillsHTML = '<ul class="pills">'
'<li><a href="#home">Home</a></li>' + + '<li><a href="#home">Home</a></li>'
'<li><a href="#profile">Profile</a></li>' + + '<li><a href="#profile">Profile</a></li>'
'</ul>' + '</ul>'
$('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture') $('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture')
@ -77,14 +77,14 @@ $(function () {
test('show and shown events should reference correct relatedTarget', function () { test('show and shown events should reference correct relatedTarget', function () {
stop() stop()
var dropHTML = '<ul class="drop">' + var dropHTML = '<ul class="drop">'
'<li class="dropdown"><a data-toggle="dropdown" href="#">1</a>' + + '<li class="dropdown"><a data-toggle="dropdown" href="#">1</a>'
'<ul class="dropdown-menu">' + + '<ul class="dropdown-menu">'
'<li><a href="#1-1" data-toggle="tab">1-1</a></li>' + + '<li><a href="#1-1" data-toggle="tab">1-1</a></li>'
'<li><a href="#1-2" data-toggle="tab">1-2</a></li>' + + '<li><a href="#1-2" data-toggle="tab">1-2</a></li>'
'</ul>' + + '</ul>'
'</li>' + + '</li>'
'</ul>' + '</ul>'
$(dropHTML) $(dropHTML)
.find('ul > li:first a') .find('ul > li:first a')

View File

@ -431,11 +431,11 @@ $(function () {
test('should place tooltip on top of element', function () { test('should place tooltip on top of element', function () {
stop() stop()
var containerHTML = '<div>' + var containerHTML = '<div>'
'<p style="margin-top: 200px">' + + '<p style="margin-top: 200px">'
'<a href="#" title="very very very very very very very long tooltip">Hover me</a>' + + '<a href="#" title="very very very very very very very long tooltip">Hover me</a>'
'</p>' + + '</p>'
'</div>' + '</div>'
var $container = $(containerHTML) var $container = $(containerHTML)
.css({ .css({
position: 'absolute', position: 'absolute',
@ -466,10 +466,10 @@ $(function () {
}) })
test('should add position class before positioning so that position-specific styles are taken into account', function () { test('should add position class before positioning so that position-specific styles are taken into account', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip.right { white-space: nowrap; }' + + '.tooltip.right { white-space: nowrap; }'
'.tooltip.right .tooltip-inner { max-width: none; }' + + '.tooltip.right .tooltip-inner { max-width: none; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div/>').appendTo(document.body) var $container = $('<div/>').appendTo(document.body)
@ -581,10 +581,10 @@ $(function () {
}) })
test('should adjust the tip\'s top position when up against the top of the viewport', function () { test('should adjust the tip\'s top position when up against the top of the viewport', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }' + + '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
'a[rel="tooltip"] { position: fixed; }' + + 'a[rel="tooltip"] { position: fixed; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div/>').appendTo(document.body) var $container = $('<div/>').appendTo(document.body)
@ -609,10 +609,10 @@ $(function () {
}) })
test('should adjust the tip\'s top position when up against the bottom of the viewport', function () { test('should adjust the tip\'s top position when up against the bottom of the viewport', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }' + + '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
'a[rel="tooltip"] { position: fixed; }' + + 'a[rel="tooltip"] { position: fixed; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div/>').appendTo(document.body) var $container = $('<div/>').appendTo(document.body)
@ -638,10 +638,10 @@ $(function () {
}) })
test('should adjust the tip\'s left position when up against the left of the viewport', function () { test('should adjust the tip\'s left position when up against the left of the viewport', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }' + + '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
'a[rel="tooltip"] { position: fixed; }' + + 'a[rel="tooltip"] { position: fixed; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div/>').appendTo(document.body) var $container = $('<div/>').appendTo(document.body)
@ -666,10 +666,10 @@ $(function () {
}) })
test('should adjust the tip\'s left position when up against the right of the viewport', function () { test('should adjust the tip\'s left position when up against the right of the viewport', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }' + + '.tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
'a[rel="tooltip"] { position: fixed; }' + + 'a[rel="tooltip"] { position: fixed; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div/>').appendTo('body') var $container = $('<div/>').appendTo('body')
@ -695,11 +695,11 @@ $(function () {
}) })
test('should adjust the tip when up against the right of an arbitrary viewport', function () { test('should adjust the tip when up against the right of an arbitrary viewport', function () {
var styles = '<style>' + var styles = '<style>'
'.tooltip, .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }' + + '.tooltip, .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; }'
'.container-viewport { position: absolute; top: 50px; left: 60px; width: 300px; height: 300px; }' + + '.container-viewport { position: absolute; top: 50px; left: 60px; width: 300px; height: 300px; }'
'a[rel="tooltip"] { position: fixed; }' + + 'a[rel="tooltip"] { position: fixed; }'
'</style>' + '</style>'
var $styles = $(styles).appendTo(document.head) var $styles = $(styles).appendTo(document.head)
var $container = $('<div class="container-viewport"/>').appendTo(document.body) var $container = $('<div class="container-viewport"/>').appendTo(document.body)