diff options
| author | Mark Otto <[email protected]> | 2012-02-19 14:54:53 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-02-19 14:54:53 -0800 |
| commit | adbbf17ee4a241b14503289e6726fc52acefc8a4 (patch) | |
| tree | ac7cc57aca1e989f6b72f0311660b7d2a458884a | |
| parent | 16d12396d0f1f352280ae195ac60a15e7e95d666 (diff) | |
| parent | 532242e626c36beb3985e23f3f119373db21262a (diff) | |
| download | bootstrap-adbbf17ee4a241b14503289e6726fc52acefc8a4.tar.xz bootstrap-adbbf17ee4a241b14503289e6726fc52acefc8a4.zip | |
Merge branch '2.0.2-wip' of github.com:twitter/bootstrap into 2.0.2-wip
Conflicts:
docs/assets/bootstrap.zip
| -rw-r--r-- | docs/assets/bootstrap.zip | bin | 53366 -> 53408 bytes | |||
| -rw-r--r-- | docs/assets/css/bootstrap.css | 1 | ||||
| -rw-r--r-- | docs/assets/js/bootstrap-button.js | 4 | ||||
| -rw-r--r-- | js/bootstrap-button.js | 4 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-button.js | 25 | ||||
| -rw-r--r-- | less/dropdowns.less | 1 |
6 files changed, 30 insertions, 5 deletions
diff --git a/docs/assets/bootstrap.zip b/docs/assets/bootstrap.zip Binary files differindex fcf656217..75ca96a36 100644 --- a/docs/assets/bootstrap.zip +++ b/docs/assets/bootstrap.zip diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 535f20a51..fac71d57b 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -1581,7 +1581,6 @@ table .span12 { float: left; display: none; min-width: 160px; - _width: 160px; padding: 4px 0; margin: 0; list-style: none; diff --git a/docs/assets/js/bootstrap-button.js b/docs/assets/js/bootstrap-button.js index a0e053547..0238ca3cb 100644 --- a/docs/assets/js/bootstrap-button.js +++ b/docs/assets/js/bootstrap-button.js @@ -91,7 +91,9 @@ $(function () { $('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') }) }) diff --git a/js/bootstrap-button.js b/js/bootstrap-button.js index a0e053547..0238ca3cb 100644 --- a/js/bootstrap-button.js +++ b/js/bootstrap-button.js @@ -91,7 +91,9 @@ $(function () { $('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') }) }) diff --git a/js/tests/unit/bootstrap-button.js b/js/tests/unit/bootstrap-button.js index 8aed857e1..03c4a8e9d 100644 --- a/js/tests/unit/bootstrap-button.js +++ b/js/tests/unit/bootstrap-button.js @@ -45,10 +45,33 @@ $(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') btn.button('toggle') 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') + }) + })
\ No newline at end of file diff --git a/less/dropdowns.less b/less/dropdowns.less index 1b445844c..88a7462c4 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -46,7 +46,6 @@ float: left; display: none; // none by default, but block on "open" of the menu min-width: 160px; - _width: 160px; padding: 4px 0; margin: 0; // override default ul list-style: none; |
