diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index a08952a4cfdc03a5907f2a4b5b7f77ddccb13581..cd9cd091315c7703c066fb6c3fdba6de3946e7ab 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -185,7 +185,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 ba51347433ffaa12bfbaad5023fd71865089e390..eb8beeb6f3235eaea1cb3b9f74246c6c8076bedd 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 () {