Commit 44cc7632 authored by Heinrich Fenkart's avatar Heinrich Fenkart

grunt

parent 0e991ccb
...@@ -1821,8 +1821,9 @@ if (typeof jQuery === 'undefined') { ...@@ -1821,8 +1821,9 @@ if (typeof jQuery === 'undefined') {
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) { if (activeTarget && scrollTop < offsets[0]) {
return activeTarget != (i = targets[0]) && this.activate(i) this.activeTarget = null
return this.clear()
} }
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
...@@ -1836,9 +1837,7 @@ if (typeof jQuery === 'undefined') { ...@@ -1836,9 +1837,7 @@ if (typeof jQuery === 'undefined') {
ScrollSpy.prototype.activate = function (target) { ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target this.activeTarget = target
$(this.selector) this.clear()
.parentsUntil(this.options.target, '.active')
.removeClass('active')
var selector = this.selector + var selector = this.selector +
'[data-target="' + target + '"],' + '[data-target="' + target + '"],' +
...@@ -1857,6 +1856,12 @@ if (typeof jQuery === 'undefined') { ...@@ -1857,6 +1856,12 @@ if (typeof jQuery === 'undefined') {
active.trigger('activate.bs.scrollspy') active.trigger('activate.bs.scrollspy')
} }
ScrollSpy.prototype.clear = function () {
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
// SCROLLSPY PLUGIN DEFINITION // SCROLLSPY PLUGIN DEFINITION
// =========================== // ===========================
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -1821,8 +1821,9 @@ if (typeof jQuery === 'undefined') { ...@@ -1821,8 +1821,9 @@ if (typeof jQuery === 'undefined') {
return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
} }
if (activeTarget && scrollTop <= offsets[0]) { if (activeTarget && scrollTop < offsets[0]) {
return activeTarget != (i = targets[0]) && this.activate(i) this.activeTarget = null
return this.clear()
} }
for (i = offsets.length; i--;) { for (i = offsets.length; i--;) {
...@@ -1836,9 +1837,7 @@ if (typeof jQuery === 'undefined') { ...@@ -1836,9 +1837,7 @@ if (typeof jQuery === 'undefined') {
ScrollSpy.prototype.activate = function (target) { ScrollSpy.prototype.activate = function (target) {
this.activeTarget = target this.activeTarget = target
$(this.selector) this.clear()
.parentsUntil(this.options.target, '.active')
.removeClass('active')
var selector = this.selector + var selector = this.selector +
'[data-target="' + target + '"],' + '[data-target="' + target + '"],' +
...@@ -1857,6 +1856,12 @@ if (typeof jQuery === 'undefined') { ...@@ -1857,6 +1856,12 @@ if (typeof jQuery === 'undefined') {
active.trigger('activate.bs.scrollspy') active.trigger('activate.bs.scrollspy')
} }
ScrollSpy.prototype.clear = function () {
$(this.selector)
.parentsUntil(this.options.target, '.active')
.removeClass('active')
}
// SCROLLSPY PLUGIN DEFINITION // SCROLLSPY PLUGIN DEFINITION
// =========================== // ===========================
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment