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:
4
js/bootstrap-popover.js
vendored
4
js/bootstrap-popover.js
vendored
@@ -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 );
|
2
js/bootstrap-twipsy.js
vendored
2
js/bootstrap-twipsy.js
vendored
@@ -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 );
|
Reference in New Issue
Block a user