aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-popover.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-09-11 21:03:17 -0700
committerJacob Thornton <[email protected]>2011-09-11 21:03:17 -0700
commit200f5817ba7eb4c9ccafed3faad45b06ba89dfa7 (patch)
tree5ad41601586f7a96a74ae4d8979a755680febc24 /js/bootstrap-popover.js
parente255b4f51dd690cbdcf75a1a7e93ddc5c07499f2 (diff)
downloadbootstrap-200f5817ba7eb4c9ccafed3faad45b06ba89dfa7.tar.xz
bootstrap-200f5817ba7eb4c9ccafed3faad45b06ba89dfa7.zip
method invocation jqueryui style
Diffstat (limited to 'js/bootstrap-popover.js')
-rw-r--r--js/bootstrap-popover.js22
1 files changed, 7 insertions, 15 deletions
diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js
index 4995fe5d8..bf1278325 100644
--- a/js/bootstrap-popover.js
+++ b/js/bootstrap-popover.js
@@ -24,6 +24,7 @@
this.$element = $(element)
this.options = options
this.enabled = true
+ this.fixTitle()
}
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
@@ -38,22 +39,13 @@
$tip[0].className = 'popover'
}
- , fixTitle: function () {}
+ , getContent: function () {
+ var contentvar
+ , $e = this.$element
+ , o = this.options
- , getTitle: function () {
- var title
- if (typeof this.options.title == 'string') {
- title = this.$element.attr('data-title') || this.options.title
- } else if (typeof this.options.title == 'function') {
- title = this.options.title.call(this.$element[0])
- }
- return title
- }
-
- , getContent: function () {content
- var content
if (typeof this.options.content == 'string') {
- content = this.$element.attr('data-content') || this.options.content
+ content = $e.attr(o.content)
} else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0])
}
@@ -80,6 +72,6 @@
return this
}
- $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'content', placement: 'right'})
+ $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'})
})( jQuery || ender ) \ No newline at end of file