don't remove title attribute for tooltips

fixes #6445
This commit is contained in:
pseidemann 2013-01-29 22:54:00 +01:00
parent 558bc52432
commit c4eea3abde
2 changed files with 3 additions and 3 deletions

View File

@ -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', '')
}
}

View File

@ -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 () {