diff options
| author | fat-kun <[email protected]> | 2013-02-05 20:13:57 -0800 |
|---|---|---|
| committer | fat-kun <[email protected]> | 2013-02-05 20:13:57 -0800 |
| commit | ee91afba63bc6e9687397b9052858fca242c2ff5 (patch) | |
| tree | 1c347e809b32eb49b23a42929451e6830a13ab8a | |
| parent | 558bc52432840ea1b2f413438427164288f10350 (diff) | |
| parent | c4eea3abde487567961fccab0d0cafd8bd4a7718 (diff) | |
| download | bootstrap-ee91afba63bc6e9687397b9052858fca242c2ff5.tar.xz bootstrap-ee91afba63bc6e9687397b9052858fca242c2ff5.zip | |
Merge pull request #6481 from pseidemann/patch-1
don't remove title attribute for tooltips
| -rw-r--r-- | js/bootstrap-tooltip.js | 2 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-tooltip.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index a08952a4c..cd9cd0913 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 ba5134743..eb8beeb6f 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 () { |
