Skip to content

Commit

Permalink
removed twipsy options
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Nov 7, 2011
1 parent d725ac2 commit 1b43c87
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
6 changes: 0 additions & 6 deletions docs/javascript.html
Expand Up @@ -559,12 +559,6 @@ <h3>Options</h3>
<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>
Expand Down
5 changes: 2 additions & 3 deletions js/bootstrap-twipsy.js
Expand Up @@ -119,7 +119,7 @@

, 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'
}

Expand Down Expand Up @@ -302,7 +302,6 @@
, title: 'title'
, trigger: 'hover'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
, contentSelector: '.twipsy-inner'
}

$.fn.twipsy.rejectAttrOptions = [ 'title' ]
Expand All @@ -319,4 +318,4 @@
return $.extend({}, options, data)
}

}( window.jQuery || window.ender );
}( window.jQuery || window.ender );
2 changes: 1 addition & 1 deletion js/tests/unit/bootstrap-popover.js
Expand Up @@ -78,7 +78,7 @@ $(function () {
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
Expand Down
20 changes: 1 addition & 19 deletions js/tests/unit/bootstrap-twipsy.js
Expand Up @@ -78,22 +78,4 @@ $(function () {
$('#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()
})
})
})

0 comments on commit 1b43c87

Please sign in to comment.