bindUrlsToRoutes: (selectors = null)->
@_logMessage 'Binding routes to links'
$('body').off 'click.scrollingSite.route'
if selectors is null
selectors = (for a in $('a:not([data-nobind])')
href = $(a).attr('href')
continue unless href
section = @_fragmentToSection(href)
continue unless section
continue unless section.el.length
"[href='#{href}']"
).unique().join(',')
handler = (e) =>
e.preventDefault()
@navigate $(e.currentTarget).attr 'href'
if selectors
$('body').on 'click.scrollingSite.route', selectors, handler
$(selectors).attr 'data-scrolling-site-bound', 'true'
startHistory: (pushState = true, silent = false, root = '/') ->
return if Backbone.History.started
@_logMessage 'Starting Backbone.history'
Backbone.history.start
pushState: pushState
silent: silent
root: root
if silent isnt true
@navigate window.location.pathname + window.location.search