From 8b959cacbc26666c13fd0e893a3f563ac4f9d09e Mon Sep 17 00:00:00 2001 From: Godric Date: Tue, 4 Dec 2012 01:21:07 +0100 Subject: Update js/bootstrap-scrollspy.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for Bootstrap issue #6013 "scrollSpy - offset calculation" https://github.com/twitter/bootstrap/issues/6013 --- js/bootstrap-scrollspy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/bootstrap-scrollspy.js') diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js index 3ffda2ebe..ace6b8703 100644 --- a/js/bootstrap-scrollspy.js +++ b/js/bootstrap-scrollspy.js @@ -59,7 +59,7 @@ , $href = /^#\w/.test(href) && $(href) return ( $href && $href.length - && [[ $href.position().top, href ]] ) || null + && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null }) .sort(function (a, b) { return a[0] - b[0] }) .each(function () { -- cgit v1.2.3 From a7eb9c294a575b5471ddec45ae75e1d09f7ace4c Mon Sep 17 00:00:00 2001 From: fat Date: Fri, 7 Dec 2012 17:06:01 -0500 Subject: add noConflict functionality to all bootstrap plugins --- js/bootstrap-scrollspy.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js/bootstrap-scrollspy.js') diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js index 34f774868..fd82872c5 100644 --- a/js/bootstrap-scrollspy.js +++ b/js/bootstrap-scrollspy.js @@ -121,6 +121,8 @@ /* SCROLLSPY PLUGIN DEFINITION * =========================== */ + var old = $.fn.scrollspy + $.fn.scrollspy = function (option) { return this.each(function () { var $this = $(this) @@ -138,6 +140,15 @@ } + /* SCROLLSPY NO CONFLICT + * ===================== */ + + $.fn.scrollspy.noConflict = function () { + $.fn.scrollspy = old + return this + } + + /* SCROLLSPY DATA-API * ================== */ -- cgit v1.2.3