Skip to content

Commit 0c7a80c

Browse files
committed
remove selector options for popover, in favor of more generic content selector
1 parent b37a336 commit 0c7a80c

File tree

3 files changed

+2
-39
lines changed

3 files changed

+2
-39
lines changed

docs/javascript.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -691,18 +691,6 @@ <h3>Options</h3>
691691
<td>[default markup]</td>
692692
<td>the html template used for rendering a popover</td>
693693
</tr>
694-
<tr>
695-
<td>titleSelector</td>
696-
<td>string</td>
697-
<td>.title</td>
698-
<td>selector used to find the title element within the popover</td>
699-
</tr>
700-
<tr>
701-
<td>contentSelector</td>
702-
<td>string</td>
703-
<td>.content p</td>
704-
<td>selector used to find the content element within the popover</td>
705-
</tr>
706694
</tbody>
707695
</table>
708696
<p><span class="label notice">Notice</span> Individual popover instance options can alternatively be specified through the use of data attributes.</code></p>

js/bootstrap-popover.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
setContent: function () {
3838
var $tip = this.tip()
39-
$tip.find(this.options.titleSelector)[this.options.html ? 'html' : 'text'](this.getTitle())
40-
$tip.find(this.options.contentSelector)[this.options.html ? 'html' : 'text'](this.getContent())
39+
$tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
40+
$tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent())
4141
$tip[0].className = 'popover'
4242
}
4343

@@ -83,8 +83,6 @@
8383
placement: 'right'
8484
, content: 'data-content'
8585
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
86-
, titleSelector: '.title'
87-
, contentSelector: '.content p'
8886
})
8987

9088
$.fn.twipsy.rejectAttrOptions.push( 'content' )

js/tests/unit/bootstrap-popover.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,4 @@ $(function () {
7373
$('#qunit-runoff').empty()
7474
})
7575

76-
test("should allow arbitrary template html with title and content selector options", function() {
77-
$.support.transition = false
78-
var expectedTitle = 'Gotta make you understand'
79-
, popover = $('<a href="#">@rvagg</a>')
80-
.attr('title', expectedTitle)
81-
.attr('data-content', '<p><b>Never gonna give you up</b>,</p><p>Never gonna let you down</p>')
82-
.appendTo('#qunit-runoff')
83-
.popover({
84-
html: true
85-
, titleSelector: 'h1'
86-
, contentSelector: '.rick > .roll'
87-
, template: '<div class="rick"><h1></h1><div class="roll"></div></div>'
88-
})
89-
.popover('show')
90-
91-
ok($('.popover > div > h1').length, 'h1 tag was inserted')
92-
ok($('.popover > div > h1').text() === expectedTitle)
93-
ok($('.popover > .rick > .roll > p').length === 2, 'p > b tags were inserted')
94-
popover.popover('hide')
95-
ok(!$('.popover').length, 'popover was removed')
96-
$('#qunit-runoff').empty()
97-
})
98-
9976
})

0 commit comments

Comments
 (0)