2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-20 20:00:36 +03:00

add template option and make title an optional attribute for popover

This commit is contained in:
Jacob Thornton
2011-10-29 19:59:51 -07:00
parent 640fd15464
commit 169b4b5dcb
3 changed files with 29 additions and 5 deletions
+7 -2
View File
@@ -72,7 +72,7 @@
, $tip
, tp
if (this.getTitle() && this.enabled) {
if (this.hasContent() && this.enabled) {
$tip = this.tip()
this.setContent()
@@ -145,6 +145,10 @@
}
}
, hasContent: function () {
return this.getTitle()
}
, getTitle: function() {
var title
, $e = this.$element
@@ -165,7 +169,7 @@
, tip: function() {
if (!this.$tip) {
this.$tip = $('<div class="twipsy" />').html('<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>')
this.$tip = $('<div class="twipsy" />').html(this.options.template)
}
return this.$tip
}
@@ -296,6 +300,7 @@
, offset: 0
, title: 'title'
, trigger: 'hover'
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
}
$.fn.twipsy.elementOptions = function(ele, options) {