Skip to content

Commit

Permalink
update bootstrap javascript to v2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
m5o committed Jun 1, 2012
1 parent 46f5c11 commit 6824c61
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 26 deletions.
2 changes: 1 addition & 1 deletion js/bootstrap-alert.js
@@ -1,5 +1,5 @@
/* ========================================================== /* ==========================================================
* bootstrap-alert.js v2.0.3 * bootstrap-alert.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#alerts * http://twitter.github.com/bootstrap/javascript.html#alerts
* ========================================================== * ==========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-button.js
@@ -1,5 +1,5 @@
/* ============================================================ /* ============================================================
* bootstrap-button.js v2.0.3 * bootstrap-button.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#buttons * http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================ * ============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-carousel.js
@@ -1,5 +1,5 @@
/* ========================================================== /* ==========================================================
* bootstrap-carousel.js v2.0.3 * bootstrap-carousel.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#carousel * http://twitter.github.com/bootstrap/javascript.html#carousel
* ========================================================== * ==========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-collapse.js
@@ -1,5 +1,5 @@
/* ============================================================= /* =============================================================
* bootstrap-collapse.js v2.0.3 * bootstrap-collapse.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#collapse * http://twitter.github.com/bootstrap/javascript.html#collapse
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-dropdown.js
@@ -1,5 +1,5 @@
/* ============================================================ /* ============================================================
* bootstrap-dropdown.js v2.0.3 * bootstrap-dropdown.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#dropdowns * http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================ * ============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-modal.js
@@ -1,5 +1,5 @@
/* ========================================================= /* =========================================================
* bootstrap-modal.js v2.0.3 * bootstrap-modal.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#modals * http://twitter.github.com/bootstrap/javascript.html#modals
* ========================================================= * =========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-popover.js
@@ -1,5 +1,5 @@
/* =========================================================== /* ===========================================================
* bootstrap-popover.js v2.0.3 * bootstrap-popover.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#popovers * http://twitter.github.com/bootstrap/javascript.html#popovers
* =========================================================== * ===========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-scrollspy.js
@@ -1,5 +1,5 @@
/* ============================================================= /* =============================================================
* bootstrap-scrollspy.js v2.0.3 * bootstrap-scrollspy.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#scrollspy * http://twitter.github.com/bootstrap/javascript.html#scrollspy
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-tab.js
@@ -1,5 +1,5 @@
/* ======================================================== /* ========================================================
* bootstrap-tab.js v2.0.3 * bootstrap-tab.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#tabs * http://twitter.github.com/bootstrap/javascript.html#tabs
* ======================================================== * ========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
6 changes: 3 additions & 3 deletions js/bootstrap-tooltip.js
@@ -1,5 +1,5 @@
/* =========================================================== /* ===========================================================
* bootstrap-tooltip.js v2.0.3 * bootstrap-tooltip.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#tooltips * http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame * Inspired by the original jQuery.tipsy by Jason Frame
* =========================================================== * ===========================================================
Expand Down Expand Up @@ -84,9 +84,9 @@
, leave: function (e) { , leave: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type) var self = $(e.currentTarget)[this.type](this._options).data(this.type)


if (this.timeout) clearTimeout(this.timeout)
if (!self.options.delay || !self.options.delay.hide) return self.hide() if (!self.options.delay || !self.options.delay.hide) return self.hide()


clearTimeout(this.timeout)
self.hoverState = 'out' self.hoverState = 'out'
this.timeout = setTimeout(function() { this.timeout = setTimeout(function() {
if (self.hoverState == 'out') self.hide() if (self.hoverState == 'out') self.hide()
Expand Down Expand Up @@ -272,4 +272,4 @@
, delay: 0 , delay: 0
} }


}(window.jQuery); }(window.jQuery);
2 changes: 1 addition & 1 deletion js/bootstrap-transition.js
@@ -1,5 +1,5 @@
/* =================================================== /* ===================================================
* bootstrap-transition.js v2.0.3 * bootstrap-transition.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#transitions * http://twitter.github.com/bootstrap/javascript.html#transitions
* =================================================== * ===================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion js/bootstrap-typeahead.js
@@ -1,5 +1,5 @@
/* ============================================================= /* =============================================================
* bootstrap-typeahead.js v2.0.3 * bootstrap-typeahead.js v2.0.4
* http://twitter.github.com/bootstrap/javascript.html#typeahead * http://twitter.github.com/bootstrap/javascript.html#typeahead
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
Expand Down
43 changes: 31 additions & 12 deletions js/tests/unit/bootstrap-tooltip.js
Expand Up @@ -33,7 +33,7 @@ $(function () {
.tooltip({placement: 'bottom'}) .tooltip({placement: 'bottom'})
.tooltip('show') .tooltip('show')


ok($(".tooltip").hasClass('fade bottom in'), 'has correct classes applied') ok($(".tooltip").is('.fade.bottom.in'), 'has correct classes applied')
tooltip.tooltip('hide') tooltip.tooltip('hide')
}) })


Expand Down Expand Up @@ -69,10 +69,29 @@ $(function () {
tooltip.trigger('mouseenter') tooltip.trigger('mouseenter')


setTimeout(function () { setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in') ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
tooltip.trigger('mouseout') tooltip.trigger('mouseout')
setTimeout(function () { setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in') ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
start()
}, 200)
}, 100)
})

test("should not show tooltip if leave event occurs before delay expires, even if hide delay is 0", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture')
.tooltip({ delay: { show: 200, hide: 0} })

stop()

tooltip.trigger('mouseenter')

setTimeout(function () {
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
tooltip.trigger('mouseout')
setTimeout(function () {
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
start() start()
}, 200) }, 200)
}, 100) }, 100)
Expand All @@ -85,10 +104,10 @@ $(function () {
stop() stop()
tooltip.trigger('mouseenter') tooltip.trigger('mouseenter')
setTimeout(function () { setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in') ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
tooltip.trigger('mouseout') tooltip.trigger('mouseout')
setTimeout(function () { setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in') ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
start() start()
}, 100) }, 100)
}, 50) }, 50)
Expand All @@ -97,16 +116,16 @@ $(function () {
test("should show tooltip if leave event hasn't occured before delay expires", function () { test("should show tooltip if leave event hasn't occured before delay expires", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>') var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.tooltip({ delay: 200 }) .tooltip({ delay: 150 })
stop() stop()
tooltip.trigger('mouseenter') tooltip.trigger('mouseenter')
setTimeout(function () { setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in') ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
setTimeout(function () {
ok(!$(".tooltip").hasClass('fade in'), 'tooltip has faded in')
start()
}, 200)
}, 100) }, 100)
setTimeout(function () {
ok($(".tooltip").is('.fade.in'), 'tooltip has faded in')
start()
}, 200)
}) })


test("should detect if title string is html or text: foo", function () { test("should detect if title string is html or text: foo", function () {
Expand All @@ -133,4 +152,4 @@ $(function () {
ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html') ok($.fn.tooltip.Constructor.prototype.isHTML($('<div></div>')), 'correctly detected html')
}) })


}) })

0 comments on commit 6824c61

Please sign in to comment.