From f7c360d6206a8c5d2393215239649f9234bb600b Mon Sep 17 00:00:00 2001 From: Suleman Chikhalia Date: Thu, 27 Feb 2014 00:39:46 -0800 Subject: [PATCH 1/5] Fixed flickering and simplified calculations - Removed offending line causing a flicker to the default top state - Simplified calculation of the top offset when in the bottom state --- js/affix.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/affix.js b/js/affix.js index 05c909e16..60613b611 100644 --- a/js/affix.js +++ b/js/affix.js @@ -55,8 +55,6 @@ var offsetTop = offset.top var offsetBottom = offset.bottom - if (this.affixed == 'top') position.top += scrollTop - if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element) if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element) @@ -84,7 +82,7 @@ .trigger($.Event(affixType.replace('affix', 'affixed'))) if (affix == 'bottom') { - this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() }) + this.$element.offset({ top: position.top }) } } From 0f366e03765ce1daa932562b77de78eb5f90ac28 Mon Sep 17 00:00:00 2001 From: Tobias Lindig Date: Wed, 22 Jan 2014 14:09:41 +0100 Subject: [PATCH 2/5] correct event naming of `scroll` and `load' event closes #12337 --- dist/js/bootstrap.js | 4 ++-- js/scrollspy.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index bf6a6a202..5a130ff02 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -1578,7 +1578,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') - this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) + this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 @@ -1702,7 +1702,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // SCROLLSPY DATA-API // ================== - $(window).on('load', function () { + $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) $spy.scrollspy($spy.data()) diff --git a/js/scrollspy.js b/js/scrollspy.js index fc907f11b..137bd373f 100644 --- a/js/scrollspy.js +++ b/js/scrollspy.js @@ -19,7 +19,7 @@ this.$element = $(element).is('body') ? $(window) : $(element) this.$body = $('body') - this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) + this.$scrollElement = this.$element.on('scroll.bs.scrollspy', process) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 @@ -143,7 +143,7 @@ // SCROLLSPY DATA-API // ================== - $(window).on('load', function () { + $(window).on('load.bs.scrollspy.data-api', function () { $('[data-spy="scroll"]').each(function () { var $spy = $(this) $spy.scrollspy($spy.data()) From ead17b7ca6342ceb39b614d7179b9031902ea63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatan=20Vasovi=C4=87?= Date: Sat, 25 Jan 2014 12:16:45 +0100 Subject: [PATCH 3/5] Fix #12375: stop using document.body.scrollTop as it's deprecated in the strict mode Closes #12377 --- dist/js/bootstrap.js | 2 +- js/tooltip.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 5a130ff02..1bf7ffafa 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -1208,7 +1208,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re var $parent = this.$element.parent() var orgPlacement = placement - var docScroll = document.documentElement.scrollTop || document.body.scrollTop + var docScroll = document.documentElement.scrollTop var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left diff --git a/js/tooltip.js b/js/tooltip.js index 7b75d7939..eb7875c9f 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -160,7 +160,7 @@ var $parent = this.$element.parent() var orgPlacement = placement - var docScroll = document.documentElement.scrollTop || document.body.scrollTop + var docScroll = document.documentElement.scrollTop var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left From 4e4e4563418e44a2f73c6a4ec4299105824f7eda Mon Sep 17 00:00:00 2001 From: Heinrich Fenkart Date: Wed, 26 Feb 2014 02:04:38 +0100 Subject: [PATCH 4/5] Fix #12845 - Modal#hide should only be called with an event argument Closes #12850 --- dist/js/bootstrap.js | 2 +- js/modal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index 1bf7ffafa..b9ae0fc11 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -817,7 +817,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re } Modal.prototype.toggle = function (_relatedTarget) { - return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) + return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { diff --git a/js/modal.js b/js/modal.js index 454d7d57a..ec358696f 100644 --- a/js/modal.js +++ b/js/modal.js @@ -36,7 +36,7 @@ } Modal.prototype.toggle = function (_relatedTarget) { - return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) + return this.isShown ? this.hide() : this.show(_relatedTarget) } Modal.prototype.show = function (_relatedTarget) { From 96525fdec431f8d654ce0ea9b4f92c2a3ef9104b Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Sun, 16 Mar 2014 20:30:04 -0700 Subject: [PATCH 5/5] move sauce_browsers.yml into /grunt/; fixes #13065 --- Gruntfile.js | 2 +- bower.json | 3 ++- {test-infra => grunt}/sauce_browsers.yml | 0 3 files changed, 3 insertions(+), 2 deletions(-) rename {test-infra => grunt}/sauce_browsers.yml (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 7d55f4089..4cfcade9f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -390,7 +390,7 @@ module.exports = function (grunt) { build: process.env.TRAVIS_JOB_ID, concurrency: 10, urls: ['http://127.0.0.1:3000/js/tests/index.html'], - browsers: grunt.file.readYAML('test-infra/sauce_browsers.yml') + browsers: grunt.file.readYAML('grunt/sauce_browsers.yml') } } }, diff --git a/bower.json b/bower.json index 7590d787e..965ed2f1c 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,8 @@ "composer.json", "CONTRIBUTING.md", "docs", - "js/tests" + "js/tests", + "test-infra" ], "dependencies": { "jquery": ">= 1.9.0" diff --git a/test-infra/sauce_browsers.yml b/grunt/sauce_browsers.yml similarity index 100% rename from test-infra/sauce_browsers.yml rename to grunt/sauce_browsers.yml