1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 11:00:56 +02:00

Merge remote-tracking branch 'twitter/master' into poveropt

Conflicts:
	js/bootstrap-popover.js
This commit is contained in:
Rod Vagg
2011-11-07 12:02:51 +11:00
3 changed files with 17 additions and 3 deletions

View File

@@ -683,7 +683,7 @@ $('#.tabs').bind('change', function (e) {
<td>content</td> <td>content</td>
<td>string, function</td> <td>string, function</td>
<td>'data-content'</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>
<tr> <tr>
<td>trigger</td> <td>trigger</td>

View File

@@ -51,10 +51,11 @@
, o = this.options , o = this.options
if (typeof this.options.content == 'string') { if (typeof this.options.content == 'string') {
content = this.options.content content = $e.attr(this.options.content)
} else if (typeof this.options.content == 'function') { } else if (typeof this.options.content == 'function') {
content = this.options.content.call(this.$element[0]) content = this.options.content.call(this.$element[0])
} }
return content return content
} }
@@ -80,9 +81,12 @@
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right' placement: 'right'
, content: 'data-content'
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>' , template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
, titleSelector: '.title' , titleSelector: '.title'
, contentSelector: '.content p' , contentSelector: '.content p'
}) })
$.fn.twipsy.rejectAttrOptions.push( 'content' )
}( window.jQuery || window.ender ); }( window.jQuery || window.ender );

View File

@@ -305,8 +305,18 @@
, contentSelector: '.twipsy-inner' , contentSelector: '.twipsy-inner'
} }
$.fn.twipsy.rejectAttrOptions = [ 'title' ]
$.fn.twipsy.elementOptions = function(ele, options) { $.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 ); }( window.jQuery || window.ender );