1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 00:29:52 +02:00

allow the use of data attributes to define popover options

This commit is contained in:
Jacob Thornton
2011-10-29 19:27:02 -07:00
parent ea50e8aeee
commit 640fd15464
3 changed files with 8 additions and 4 deletions

View File

@@ -47,7 +47,7 @@
, o = this.options
if (typeof this.options.content == 'string') {
content = $e.attr(o.content)
content = this.options.content
} else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0])
}
@@ -74,6 +74,6 @@
return this
}
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'})
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { placement: 'right'})
}( window.jQuery || window.ender );

View File

@@ -299,7 +299,7 @@
}
$.fn.twipsy.elementOptions = function(ele, options) {
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options
return $.extend({}, options, $(ele).data())
}
}( window.jQuery || window.ender );