mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-20 20:31:26 +02:00
Rename popover classes
Part of an update to align the naming schemes across our components. - Renames .popover-title to .popover-header - Renames .popover-content to .popover-body Refs: #22092
This commit is contained in:
6
js/dist/popover.js
vendored
6
js/dist/popover.js
vendored
@@ -35,7 +35,7 @@ var Popover = function ($) {
|
||||
placement: 'right',
|
||||
trigger: 'click',
|
||||
content: '',
|
||||
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-title"></h3>' + '<div class="popover-content"></div></div>'
|
||||
template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
|
||||
});
|
||||
|
||||
var DefaultType = $.extend({}, Tooltip.DefaultType, {
|
||||
@@ -48,8 +48,8 @@ var Popover = function ($) {
|
||||
};
|
||||
|
||||
var Selector = {
|
||||
TITLE: '.popover-title',
|
||||
CONTENT: '.popover-content'
|
||||
TITLE: '.popover-header',
|
||||
CONTENT: '.popover-body'
|
||||
};
|
||||
|
||||
var Event = {
|
||||
|
2
js/dist/popover.js.map
vendored
2
js/dist/popover.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -31,8 +31,8 @@ const Popover = (($) => {
|
||||
content : '',
|
||||
template : '<div class="popover" role="tooltip">'
|
||||
+ '<div class="arrow"></div>'
|
||||
+ '<h3 class="popover-title"></h3>'
|
||||
+ '<div class="popover-content"></div></div>'
|
||||
+ '<h3 class="popover-header"></h3>'
|
||||
+ '<div class="popover-body"></div></div>'
|
||||
})
|
||||
|
||||
const DefaultType = $.extend({}, Tooltip.DefaultType, {
|
||||
@@ -45,8 +45,8 @@ const Popover = (($) => {
|
||||
}
|
||||
|
||||
const Selector = {
|
||||
TITLE : '.popover-title',
|
||||
CONTENT : '.popover-content'
|
||||
TITLE : '.popover-header',
|
||||
CONTENT : '.popover-body'
|
||||
}
|
||||
|
||||
const Event = {
|
||||
|
@@ -95,8 +95,8 @@ $(function () {
|
||||
$popover.bootstrapPopover('show')
|
||||
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.strictEqual($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@fat', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-body').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
|
||||
|
||||
$popover.bootstrapPopover('hide')
|
||||
|
||||
@@ -114,10 +114,10 @@ $(function () {
|
||||
$popover.bootstrapPopover('show')
|
||||
|
||||
assert.notEqual($('.popover').length, 0, 'popover inserted')
|
||||
assert.strictEqual($('.popover .popover-title').text(), '@glebm <3 writing tests', 'title inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted')
|
||||
assert.ok($.contains($('.popover').get(0), title), 'title node moved, not copied')
|
||||
// toLowerCase because IE8 will return <I>...</I>
|
||||
assert.strictEqual($('.popover .popover-content').html().toLowerCase(), '<i>¯\\_(ツ)_/¯</i>', 'content inserted')
|
||||
assert.strictEqual($('.popover .popover-body').html().toLowerCase(), '<i>¯\\_(ツ)_/¯</i>', 'content inserted')
|
||||
assert.ok($.contains($('.popover').get(0), content), 'content node moved, not copied')
|
||||
})
|
||||
|
||||
@@ -132,9 +132,9 @@ $(function () {
|
||||
$popover.bootstrapPopover('show')
|
||||
|
||||
assert.notEqual($('.popover').length, 0, 'popover inserted')
|
||||
assert.strictEqual($('.popover .popover-title').text(), '@glebm <3 writing tests', 'title inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted')
|
||||
assert.ok(!$.contains($('.popover').get(0), title), 'title node copied, not moved')
|
||||
assert.strictEqual($('.popover .popover-content').html(), '¯\\_(ツ)_/¯', 'content inserted')
|
||||
assert.strictEqual($('.popover .popover-body').html(), '¯\\_(ツ)_/¯', 'content inserted')
|
||||
assert.ok(!$.contains($('.popover').get(0), content), 'content node copied, not moved')
|
||||
})
|
||||
|
||||
@@ -154,14 +154,14 @@ $(function () {
|
||||
|
||||
$popover.bootstrapPopover('show')
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.equal($('.popover .popover-content').html(), $div[0].outerHTML, 'content correctly inserted')
|
||||
assert.equal($('.popover .popover-body').html(), $div[0].outerHTML, 'content correctly inserted')
|
||||
|
||||
$popover.bootstrapPopover('hide')
|
||||
assert.strictEqual($('.popover').length, 0, 'popover was removed')
|
||||
|
||||
$popover.bootstrapPopover('show')
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.equal($('.popover .popover-content').html(), $div[0].outerHTML, 'content correctly inserted')
|
||||
assert.equal($('.popover .popover-body').html(), $div[0].outerHTML, 'content correctly inserted')
|
||||
|
||||
$popover.bootstrapPopover('hide')
|
||||
assert.strictEqual($('.popover').length, 0, 'popover was removed')
|
||||
@@ -175,8 +175,8 @@ $(function () {
|
||||
.bootstrapPopover('show')
|
||||
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.strictEqual($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-content').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted')
|
||||
|
||||
$popover.bootstrapPopover('hide')
|
||||
assert.strictEqual($('.popover').length, 0, 'popover was removed')
|
||||
@@ -193,8 +193,8 @@ $(function () {
|
||||
.bootstrapPopover('show')
|
||||
|
||||
assert.notEqual($('.popover').length, 0, 'popover was inserted')
|
||||
assert.strictEqual($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-content').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted')
|
||||
assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted')
|
||||
|
||||
$popover.bootstrapPopover('hide')
|
||||
assert.strictEqual($('.popover').length, 0, 'popover was removed')
|
||||
@@ -380,8 +380,8 @@ $(function () {
|
||||
content: 7
|
||||
})
|
||||
.on('shown.bs.popover', function () {
|
||||
assert.strictEqual($('.popover .popover-title').text(), '5')
|
||||
assert.strictEqual($('.popover .popover-content').text(), '7')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '5')
|
||||
assert.strictEqual($('.popover .popover-body').text(), '7')
|
||||
done()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user