aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRod Vagg <[email protected]>2011-11-07 12:02:51 +1100
committerRod Vagg <[email protected]>2011-11-07 12:02:51 +1100
commitd725ac2feb0abc1469ff526a29de2cf426639ad2 (patch)
tree675ee94201a0cb2a9e033407d30b8bd8afd3224f
parent4d2e32e80914dbc526dcde7c743b0537ded7c853 (diff)
parentb15e24e3d460ef2cbe20f13c648b42024be096fa (diff)
downloadbootstrap-d725ac2feb0abc1469ff526a29de2cf426639ad2.tar.xz
bootstrap-d725ac2feb0abc1469ff526a29de2cf426639ad2.zip
Merge remote-tracking branch 'twitter/master' into poveropt
Conflicts: js/bootstrap-popover.js
-rw-r--r--docs/javascript.html2
-rw-r--r--js/bootstrap-popover.js6
-rw-r--r--js/bootstrap-twipsy.js12
3 files changed, 17 insertions, 3 deletions
diff --git a/docs/javascript.html b/docs/javascript.html
index 90b7be0c5..d62dd731c 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -683,7 +683,7 @@ $('#.tabs').bind('change', function (e) {
<td>content</td>
<td>string, function</td>
<td>'data-content'</td>
- <td>a string or method for retrieving content text. if none are provided, content will be sourced from a data-content attribute.</td>
+ <td>attribute or method for retrieving content text.</td>
</tr>
<tr>
<td>trigger</td>
diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js
index 128bc5412..e8b49af3c 100644
--- a/js/bootstrap-popover.js
+++ b/js/bootstrap-popover.js
@@ -51,10 +51,11 @@
, o = this.options
if (typeof this.options.content == 'string') {
- content = this.options.content
+ content = $e.attr(this.options.content)
} else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0])
}
+
return content
}
@@ -80,9 +81,12 @@
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right'
+ , content: 'data-content'
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
, titleSelector: '.title'
, contentSelector: '.content p'
})
+ $.fn.twipsy.rejectAttrOptions.push( 'content' )
+
}( window.jQuery || window.ender );
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js
index 9eb6e79f4..24c1ced8c 100644
--- a/js/bootstrap-twipsy.js
+++ b/js/bootstrap-twipsy.js
@@ -305,8 +305,18 @@
, contentSelector: '.twipsy-inner'
}
+ $.fn.twipsy.rejectAttrOptions = [ 'title' ]
+
$.fn.twipsy.elementOptions = function(ele, options) {
- return $.extend({}, options, $(ele).data())
+ var data = $(ele).data()
+ , rejects = $.fn.twipsy.rejectAttrOptions
+ , i = rejects.length
+
+ while (i--) {
+ delete data[rejects[i]]
+ }
+
+ return $.extend({}, options, data)
}
}( window.jQuery || window.ender );