Remove logs and improve feature

Elementes in the sidebar werent served as xhr
request due this feature, now it works checking
if it is an element in the sidebar
pull/1495/head
Enoc 4 years ago
parent 843e2c7bd2
commit d45cc0eb1a

@ -178,11 +178,13 @@ onclick = (event) ->
link = $.eventTarget(event)
link = link.parentNode while link and link.tagName isnt 'A'
if link and not link.target and isSameOrigin(link.href) and isSameOriginDifferentDoc(link)
event.preventDefault()
path = link.pathname + link.search + link.hash
path = path.replace /^\/\/+/, '/' # IE11 bug
page.show(path)
if link and not link.target and isSameOrigin(link.href)
if link.className.match('_list-item') or not isSameOriginDifferentDoc(link)
event.preventDefault()
path = link.pathname + link.search + link.hash
path = path.replace /^\/\/+/, '/' # IE11 bug
page.show(path)
return
@ -190,9 +192,7 @@ isSameOrigin = (url) ->
url.indexOf("#{location.protocol}//#{location.hostname}") is 0
isSameOriginDifferentDoc = (url) ->
console.log(url.pathname)
console.log(location.pathname)
url.pathname == location.pathname
url.pathname.split('/')[1] != location.pathname.split('/')[1]
updateCanonicalLink = ->
@canonicalLink ||= document.head.querySelector('link[rel="canonical"]')

Loading…
Cancel
Save