aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-09-29 23:00:10 -0700
committerJacob Thornton <[email protected]>2011-09-29 23:00:10 -0700
commita0bf8b67ff4dd827f9298563616ecc519e7924c8 (patch)
tree2dd88b4990c0a3422979ad9b3be11c2fc5079c70 /js/tests
parentb827303511d68fdb3f913aef63f97b5f77725d68 (diff)
downloadbootstrap-a0bf8b67ff4dd827f9298563616ecc519e7924c8.tar.xz
bootstrap-a0bf8b67ff4dd827f9298563616ecc519e7924c8.zip
change event to use target and relatedTarget (which more closely resembles actual event api)
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/bootstrap-tabs.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/js/tests/unit/bootstrap-tabs.js b/js/tests/unit/bootstrap-tabs.js
index 3c2610c51..1d024ecbb 100644
--- a/js/tests/unit/bootstrap-tabs.js
+++ b/js/tests/unit/bootstrap-tabs.js
@@ -51,21 +51,27 @@ $(function () {
+ '<li class="active"><a href="#home">Home</a></li>'
+ '<li><a href="#profile">Profile</a></li>'
+ '</ul>')
- , changeCount = 0
- , from
- , to;
-
- $tabsHTML.tabs().bind( "change", function (e, c){
- from = c.from;
- to = c.to;
- changeCount++
- })
-
- $tabsHTML.tabs().find('a').last().click()
-
- equals(from, "#home")
- equals(to, "#profile")
- equals(changeCount, 1)
+ , $target
+ , count = 0
+ , relatedTarget
+ , target
+
+ $tabsHTML
+ .tabs()
+ .bind( "change", function (e) {
+ target = e.target
+ relatedTarget = e.relatedTarget
+ count++
+ })
+
+ $target = $tabsHTML
+ .find('a')
+ .last()
+ .click()
+
+ equals(relatedTarget, $tabsHTML.find('a').first()[0])
+ equals(target, $target[0])
+ equals(count, 1)
})
}) \ No newline at end of file