mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-09 15:16:51 +02:00
Merge branch '2.0.2-wip' of github.com:twitter/bootstrap into 2.0.2-wip
Conflicts: docs/assets/bootstrap.zip
This commit is contained in:
Binary file not shown.
1
docs/assets/css/bootstrap.css
vendored
1
docs/assets/css/bootstrap.css
vendored
@@ -1581,7 +1581,6 @@ table .span12 {
|
|||||||
float: left;
|
float: left;
|
||||||
display: none;
|
display: none;
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
_width: 160px;
|
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
4
docs/assets/js/bootstrap-button.js
vendored
4
docs/assets/js/bootstrap-button.js
vendored
@@ -91,7 +91,9 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
||||||
$(e.currentTarget).button('toggle')
|
var $btn = $(e.target)
|
||||||
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||||
|
$btn.button('toggle')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
4
js/bootstrap-button.js
vendored
4
js/bootstrap-button.js
vendored
@@ -91,7 +91,9 @@
|
|||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
||||||
$(e.currentTarget).button('toggle')
|
var $btn = $(e.target)
|
||||||
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||||
|
$btn.button('toggle')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
25
js/tests/unit/bootstrap-button.js
vendored
25
js/tests/unit/bootstrap-button.js
vendored
@@ -45,10 +45,33 @@ $(function () {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test("should toggle active", function () {
|
test("should toggle active", function () {
|
||||||
var btn = $('<button class="btn" data-loading-text="fat">mdo</button>')
|
var btn = $('<button class="btn">mdo</button>')
|
||||||
ok(!btn.hasClass('active'), 'btn does not have active class')
|
ok(!btn.hasClass('active'), 'btn does not have active class')
|
||||||
btn.button('toggle')
|
btn.button('toggle')
|
||||||
ok(btn.hasClass('active'), 'btn has class active')
|
ok(btn.hasClass('active'), 'btn has class active')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("should toggle active when btn children are clicked", function () {
|
||||||
|
var btn = $('<button class="btn" data-toggle="button">mdo</button>')
|
||||||
|
, inner = $('<i></i>')
|
||||||
|
btn
|
||||||
|
.append(inner)
|
||||||
|
.appendTo($('#qunit-fixture'))
|
||||||
|
ok(!btn.hasClass('active'), 'btn does not have active class')
|
||||||
|
inner.click()
|
||||||
|
ok(btn.hasClass('active'), 'btn has class active')
|
||||||
|
})
|
||||||
|
|
||||||
|
test("should toggle active when btn children are clicked within btn-group", function () {
|
||||||
|
var btngroup = $('<div class="btn-group" data-toggle="buttons-checkbox"></div>')
|
||||||
|
, btn = $('<button class="btn">fat</button>')
|
||||||
|
, inner = $('<i></i>')
|
||||||
|
btngroup
|
||||||
|
.append(btn.append(inner))
|
||||||
|
.appendTo($('#qunit-fixture'))
|
||||||
|
ok(!btn.hasClass('active'), 'btn does not have active class')
|
||||||
|
inner.click()
|
||||||
|
ok(btn.hasClass('active'), 'btn has class active')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
@@ -46,7 +46,6 @@
|
|||||||
float: left;
|
float: left;
|
||||||
display: none; // none by default, but block on "open" of the menu
|
display: none; // none by default, but block on "open" of the menu
|
||||||
min-width: 160px;
|
min-width: 160px;
|
||||||
_width: 160px;
|
|
||||||
padding: 4px 0;
|
padding: 4px 0;
|
||||||
margin: 0; // override default ul
|
margin: 0; // override default ul
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
Reference in New Issue
Block a user