mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
Merge pull request #6813 from Yohn/patch-12
don't remove title attribute for tooltips for 2.3-wip
This commit is contained in:
commit
c8874ff285
2
js/bootstrap-tooltip.js
vendored
2
js/bootstrap-tooltip.js
vendored
@ -245,7 +245,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', '')
|
||||
}
|
||||
}
|
||||
|
||||
|
4
js/tests/unit/bootstrap-tooltip.js
vendored
4
js/tests/unit/bootstrap-tooltip.js
vendored
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user