aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/bootstrap-collapse.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-03-24 18:20:09 -0700
committerJacob Thornton <[email protected]>2012-03-24 18:20:09 -0700
commitbccc2cb7191eb54a4d67563625a748d7ecd381d4 (patch)
treec4562643867c197b7f7f5792694e3e10aab8de52 /js/tests/unit/bootstrap-collapse.js
parentef5ac02b698ffab3a42d21f20859b70df85543c0 (diff)
downloadbootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.tar.xz
bootstrap-bccc2cb7191eb54a4d67563625a748d7ecd381d4.zip
add preventDefault support for all inital event types (show, close, hide, etc.) + fix small bug with scrollspy.last
Diffstat (limited to 'js/tests/unit/bootstrap-collapse.js')
-rw-r--r--js/tests/unit/bootstrap-collapse.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-collapse.js b/js/tests/unit/bootstrap-collapse.js
index 698238d96..8e52898b5 100644
--- a/js/tests/unit/bootstrap-collapse.js
+++ b/js/tests/unit/bootstrap-collapse.js
@@ -22,4 +22,19 @@ $(function () {
ok(/height/.test(el.attr('style')), 'has height set')
})
+ test("should not fire shown when show is prevented", function () {
+ $.support.transition = false
+ stop();
+ $('<div class="collapse"/>')
+ .bind('show', function (e) {
+ e.preventDefault();
+ ok(true);
+ start();
+ })
+ .bind('shown', function () {
+ ok(false);
+ })
+ .collapse('show')
+ })
+
}) \ No newline at end of file