<td>[default markup]</td>
<td>the html template used for rendering a twipsy</td>
</tr>
- <tr>
- <td>contentSelector</td>
- <td>string</td>
- <td>.twipsy-inner</td>
- <td>selector used to find the title element within the tooltip</td>
- </tr>
</tbody>
</table>
<p><span class="label notice">Notice</span> Individual twipsy instance options can alternatively be specified through the use of data attributes.</code></p>
, setContent: function () {
var $tip = this.tip()
- $tip.find(this.options.contentSelector)[this.options.html ? 'html' : 'text'](this.getTitle())
+ $tip.find('.twipsy-inner')[this.options.html ? 'html' : 'text'](this.getTitle())
$tip[0].className = 'twipsy'
}
, title: 'title'
, trigger: 'hover'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
- , contentSelector: '.twipsy-inner'
}
$.fn.twipsy.rejectAttrOptions = [ 'title' ]
return $.extend({}, options, data)
}
-}( window.jQuery || window.ender );
+}( window.jQuery || window.ender );
\ No newline at end of file
var expectedTitle = 'Gotta make you understand'
, popover = $('<a href="#">@rvagg</a>')
.attr('title', expectedTitle)
- .data('content', '<p><b>Never gonna give you up</b>,</p><p>Never gonna let you down</p>')
+ .attr('data-content', '<p><b>Never gonna give you up</b>,</p><p>Never gonna let you down</p>')
.appendTo('#qunit-runoff')
.popover({
html: true
$('#qunit-runoff').empty()
})
- test("should allow arbitrary template html with content selector options", function() {
- $.support.transition = false
- var twipsy = $('<a href="#" rel="twipsy" title="<b>@fat</b>"></a>')
- .appendTo('#qunit-runoff')
- .twipsy({
- html: true
- , contentSelector: 'h1'
- , template: '<div><h1>Funky Twipsy!</h1><p class="funky"><b>@rvagg was here</b></p></div>'
- })
- .twipsy('show')
-
- ok($('.twipsy h1').length, 'h1 tag was inserted')
- ok($('.twipsy p>b').length, 'p > b tags were inserted')
- ok($('.twipsy h1>b').length, 'h1 tag was customised')
- twipsy.twipsy('hide')
- ok(!$(".twipsy").length, 'twipsy removed')
- $('#qunit-runoff').empty()
- })
-})
+})
\ No newline at end of file