vendor/assets/javascripts/twitter/bootstrap-popover.js in sass-twitter-bootstrap-0.1.0 vs vendor/assets/javascripts/twitter/bootstrap-popover.js in sass-twitter-bootstrap-2.0.1

- old
+ new

@@ -1,7 +1,7 @@ /* =========================================================== - * bootstrap-popover.js v2.0.4 + * bootstrap-popover.js v2.0.1 * http://twitter.github.com/bootstrap/javascript.html#popovers * =========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,23 +16,18 @@ * See the License for the specific language governing permissions and * limitations under the License. * =========================================================== */ -!function ($) { +!function( $ ) { - "use strict"; // jshint ;_; + "use strict" - - /* POPOVER PUBLIC CLASS DEFINITION - * =============================== */ - var Popover = function ( element, options ) { this.init('popover', element, options) } - /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js ========================================== */ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { @@ -41,12 +36,12 @@ , setContent: function () { var $tip = this.tip() , title = this.getTitle() , content = this.getContent() - $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title) - $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content) + $tip.find('.popover-title')[ $.type(title) == 'object' ? 'append' : 'html' ](title) + $tip.find('.popover-content > *')[ $.type(content) == 'object' ? 'append' : 'html' ](content) $tip.removeClass('fade top bottom left right in') } , hasContent: function () { @@ -59,14 +54,16 @@ , o = this.options content = $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) + content = content.toString().replace(/(^\s*|\s*$)/, "") + return content } - , tip: function () { + , tip: function() { if (!this.$tip) { this.$tip = $(this.options.template) } return this.$tip } @@ -75,11 +72,11 @@ /* POPOVER PLUGIN DEFINITION * ======================= */ - $.fn.popover = function (option) { + $.fn.popover = function ( option ) { return this.each(function () { var $this = $(this) , data = $this.data('popover') , options = typeof option == 'object' && option if (!data) $this.data('popover', (data = new Popover(this, options))) @@ -93,6 +90,6 @@ placement: 'right' , content: '' , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>' }) -}(window.jQuery); +}( window.jQuery ); \ No newline at end of file