                 window.location.hash = target
                 return
 
-            return false
+            false
 
         scrollSpy: =>
             scroll = $('body').scrollTop()


( ($) ->
    class window.DrmStickyNav
        constructor: (@nav = $('nav.drm-sticky-nav'), @activeClass = 'active', @content = $('div.sticky-nav-content')) ->
            self = @
            links = self.nav.find 'a[href^="#"]'
            hash = window.location.hash
            content = self.content
            
            if hash
                hashLink = self.nav.find "a[href='#{hash}']"
                hashLink.addClass self.activeClass
                self.nav.on 'click', "a[href='#{hash}']", self.goToSection
                hashLink.trigger 'click'
            else    
                links.first().addClass self.activeClass

            unless self.nav.length is 0
                navPosition = self.nav.position().top
                $(window).on 'scroll', -> self.affixNav navPosition
                $(window).on 'scroll', self.scrollSpy

            self.nav.on 'click', 'a[href^="#"]', -> self.goToSection.call @, self.activeClass

        affixNav: (navPosition) =>
            scroll = $('body').scrollTop()
            position = @nav.data 'position'

            if scroll > (navPosition - 100)
                @nav.addClass "sticky-#{position}"
            else
                @nav.removeClass "sticky-#{position}"

        goToSection: (activeClass) ->
            that = $ @


                getPosition = (height) ->
                    if height > 200
                        that.position().top - (that.height() / 2)
                    else    
                        that.position().top - that.height()

                # the first element's position should always be 0
                if index is 0
