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:
commit
ee91afba63
2
js/bootstrap-tooltip.js
vendored
2
js/bootstrap-tooltip.js
vendored
@ -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', '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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')
|
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 () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user