1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 12:59:05 +02:00

Comply to the new style.

This commit is contained in:
XhmikosR
2014-03-17 09:12:55 +02:00
parent 5ef9383f53
commit 7b0acf14d8
24 changed files with 171 additions and 152 deletions

View File

@@ -1,4 +1,5 @@
$(function () {
'use strict';
module('dropdowns plugin')
@@ -7,11 +8,11 @@ $(function () {
})
module('dropdowns', {
setup: function() {
setup: function () {
// Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode
$.fn.bootstrapDropdown = $.fn.dropdown.noConflict()
},
teardown: function() {
teardown: function () {
$.fn.dropdown = $.fn.bootstrapDropdown
delete $.fn.bootstrapDropdown
}
@@ -37,8 +38,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
'</ul>'
var dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
@@ -54,8 +55,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
'</ul>'
var dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
@@ -71,8 +72,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
'</ul>'
var dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
@@ -88,8 +89,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
'</ul>'
var dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().click()
ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
})
@@ -106,8 +107,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML)
'</ul>'
var dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.bootstrapDropdown()
@@ -135,10 +136,10 @@ $(function () {
' <ul class="dropdown-menu">' +
' <li><a href="#">Action 1</a></li>' +
' </ul>' +
'</div>',
dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]'),
first = dropdowns.first(),
last = dropdowns.last()
'</div>'
var dropdowns = $(dropdownHTML).appendTo('#qunit-fixture').find('[data-toggle="dropdown"]')
var first = dropdowns.first()
var last = dropdowns.last()
ok(dropdowns.length == 2, 'Should be two dropdowns')
@@ -168,8 +169,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML)
'</ul>'
var dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.bootstrapDropdown()
@@ -202,8 +203,8 @@ $(function () {
'<li><a href="#">Another link</a></li>' +
'</ul>' +
'</li>' +
'</ul>',
dropdown = $(dropdownHTML)
'</ul>'
var dropdown = $(dropdownHTML)
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.bootstrapDropdown()