diff --git a/docs/javascript.html b/docs/javascript.html index 47edf2b751..3aac2a82f8 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -555,6 +555,8 @@ $('#.tabs').bind('change', function (e) { +
Notice Individual twipsy instance options can alternatively be specified through the use of data attributes.
+<a href="#" data-placement="below" rel='twipsy' title='Some title text'>text</a>
Attaches a twipsy handler to an element collection.
@@ -669,7 +671,7 @@ $('#.tabs').bind('change', function (e) {Notice Individual popover instance options can alternatively be specified through the use of data attributes.
+<a data-placement="below" href="#" class="btn danger" rel="popover">text</a>
Initializes popovers for an element collection.
diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js index a8a1d8e7bb..e8f4ce096b 100644 --- a/js/bootstrap-popover.js +++ b/js/bootstrap-popover.js @@ -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 ); \ No newline at end of file diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index ad2938a1a8..f0e5b1b90d 100644 --- a/js/bootstrap-twipsy.js +++ b/js/bootstrap-twipsy.js @@ -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 ); \ No newline at end of file