From beb60309d1dc312bbb69ace8c47764af783792bf Mon Sep 17 00:00:00 2001 From: Yohn Date: Wed, 6 Feb 2013 06:17:48 -0500 Subject: [PATCH 1/2] dont remove title attribute part 2 --- js/bootstrap-tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 915a87ea898b..981319077e9b 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', '') } } From 60c9ff43649be2710e2896403908194c6721661b Mon Sep 17 00:00:00 2001 From: Yohn Date: Wed, 6 Feb 2013 06:20:05 -0500 Subject: [PATCH 2/2] unit tests --- js/tests/unit/bootstrap-tooltip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 97571d243e4e..5b37b4e687d0 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 = $('').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 () {