aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-02-06 13:19:50 -0800
committerMark Otto <[email protected]>2013-02-06 13:19:50 -0800
commitc8874ff2857bd2e0555dd2c43f50220c27827c9a (patch)
tree80499b02b3b625149a09087d0d9579874a1cf92f
parent2fa77bf197050a385e479e1b2e8f61d634499505 (diff)
parent60c9ff43649be2710e2896403908194c6721661b (diff)
downloadbootstrap-c8874ff2857bd2e0555dd2c43f50220c27827c9a.tar.xz
bootstrap-c8874ff2857bd2e0555dd2c43f50220c27827c9a.zip
Merge pull request #6813 from Yohn/patch-12
don't remove title attribute for tooltips for 2.3-wip
-rw-r--r--js/bootstrap-tooltip.js2
-rw-r--r--js/tests/unit/bootstrap-tooltip.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js
index 915a87ea8..981319077 100644
--- a/js/bootstrap-tooltip.js
+++ b/js/bootstrap-tooltip.js
@@ -245,7 +245,7 @@
, fixTitle: function () {
var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
+ $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
}
}
diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js
index 97571d243..5b37b4e68 100644
--- a/js/tests/unit/bootstrap-tooltip.js
+++ b/js/tests/unit/bootstrap-tooltip.js
@@ -22,9 +22,9 @@ $(function () {
ok(!!$.fn.tooltip.defaults, 'defaults is defined')
})
- test("should remove title attribute", function () {
+ test("should empty title attribute", function () {
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip()
- ok(!tooltip.attr('title'), 'title tag was removed')
+ ok(tooltip.attr('title') === '', 'title attribute was emptied')
})
test("should add data attribute for referencing original title", function () {