Commit e8fcd464 authored by Annabel Dunstone's avatar Annabel Dunstone

Check screen width before increasing max position

parent 65a175bb
......@@ -3,9 +3,7 @@ class @LayoutNav
$('#scrolling-tabs').on 'scroll', ->
currentPosition = $(this).scrollLeft()
return if currentPosition == 0
if $('.nav-control').length
maxPosition = $(this)[0].scrollWidth - $(this).parent().width() + 59
else
maxPosition = $(this)[0].scrollWidth - $(this).parent().width()
maxPosition = $(this)[0].scrollWidth - $(this).parent().width()
maxPosition += 59 if $('.nav-control').length and window.innerWidth > 480
$('.fade-out').toggleClass('end-scroll', currentPosition is maxPosition)
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