1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 05:58:25 +01:00

Merge pull request #6481 from pseidemann/patch-1

don't remove title attribute for tooltips
This commit is contained in:
fat-kun 2013-02-05 20:13:57 -08:00
commit ee91afba63
2 changed files with 3 additions and 3 deletions

View File

@ -185,7 +185,7 @@
, fixTitle: function () { , fixTitle: function () {
var $e = this.$element var $e = this.$element
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { 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', '')
} }
} }

View File

@ -22,9 +22,9 @@ $(function () {
ok(!!$.fn.tooltip.defaults, 'defaults is defined') 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() 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 () { test("should add data attribute for referencing original title", function () {