From 003fcccceb869ac0420d542bac9860f5f32e68a1 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:15:36 -0700 Subject: change tooltip/popover html default to false for xss safety net --- js/bootstrap-tooltip.js | 2 +- js/tests/unit/bootstrap-tooltip.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 78dddbead..565720476 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -269,7 +269,7 @@ , trigger: 'hover' , title: '' , delay: 0 - , html: true + , html: false } }(window.jQuery); diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 14d6b2274..964ba1ef2 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -37,10 +37,11 @@ $(function () { tooltip.tooltip('hide') }) - test("should always allow html entities", function () { + test("should allow html entities", function () { $.support.transition = false var tooltip = $('') .appendTo('#qunit-fixture') + .tooltip({html: true}) .tooltip('show') ok($('.tooltip b').length, 'b tag was inserted') -- cgit v1.2.3 From 88b1e44dd61afd8f08761346555521bd216ed73a Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:28:38 -0700 Subject: change tooltip/popover insert strategy remove modal-open class hopefully resolve z-index headaches --- js/bootstrap-modal.js | 4 ---- js/bootstrap-tooltip.js | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 041274c5b..d53f13a00 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -49,8 +49,6 @@ if (this.isShown || e.isDefaultPrevented()) return - $('body').addClass('modal-open') - this.isShown = true this.escape() @@ -96,8 +94,6 @@ this.isShown = false - $('body').removeClass('modal-open') - this.escape() $(document).off('focusin.modal') diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 565720476..14e48c856 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -121,7 +121,7 @@ $tip .remove() .css({ top: 0, left: 0, display: 'block' }) - .appendTo(inside ? this.$element : document.body) + .insertAfter(this.$element) pos = this.getPosition(inside) @@ -144,7 +144,7 @@ } $tip - .css(tp) + .offset(tp) .addClass(placement) .addClass('in') } @@ -272,4 +272,4 @@ , html: false } -}(window.jQuery); +}(window.jQuery); \ No newline at end of file -- cgit v1.2.3 From 0540b63ab0a2f9359fbd34967fbb74402534573f Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Mon, 24 Sep 2012 23:59:02 -0700 Subject: check affix pos on clicks - use timeout for clicks which scroll --- js/bootstrap-affix.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/bootstrap-affix.js b/js/bootstrap-affix.js index 96bf420d2..c6b9e97b6 100644 --- a/js/bootstrap-affix.js +++ b/js/bootstrap-affix.js @@ -28,7 +28,9 @@ var Affix = function (element, options) { this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) + this.$window = $(window) + .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) + .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) this.$element = $(element) this.checkPosition() } -- cgit v1.2.3