Skip to content

Commit

Permalink
Merge pull request twbs#6481 from pseidemann/patch-1
Browse files Browse the repository at this point in the history
don't remove title attribute for tooltips
  • Loading branch information
fat committed Feb 6, 2013
2 parents 558bc52 + c4eea3a commit ee91afb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/bootstrap-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', '')
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/bootstrap-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit ee91afb

Please sign in to comment.