no need to check for href attribute on the scrollable element

This commit is contained in:
Mike Greiling 2014-05-29 02:30:18 -05:00 committed by Chris Rebert
parent 0be4109688
commit 632313d631
1 changed files with 1 additions and 4 deletions

View File

@ -14,16 +14,13 @@
// ==========================
function ScrollSpy(element, options) {
var href
var process = $.proxy(this.process, this)
this.$element = $(element).is('body') ? $(window) : $(element)
this.$body = $('body')
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
|| '') + ' .nav li > a'
this.selector = (this.options.target || '') + ' .nav li > a'
this.offsets = []
this.targets = []
this.activeTarget = null