2016-05-12 09:23:31 -04:00
|
|
|
class @LayoutNav
|
2016-05-16 15:58:15 -04:00
|
|
|
$ ->
|
2016-05-24 12:30:53 -04:00
|
|
|
$('.fade-left').addClass('end-scroll')
|
2016-05-25 18:12:39 -04:00
|
|
|
$('.scrolling-tabs').on 'scroll', (event) ->
|
|
|
|
$this = $(this)
|
|
|
|
$el = $(event.target)
|
|
|
|
currentPosition = $this.scrollLeft()
|
|
|
|
size = bp.getBreakpointSize()
|
2016-05-18 12:38:12 -04:00
|
|
|
controlBtnWidth = $('.controls').width()
|
2016-05-25 18:12:39 -04:00
|
|
|
maxPosition = $this.get(0).scrollWidth - $this.parent().width()
|
|
|
|
maxPosition += controlBtnWidth if size isnt 'xs' and $('.nav-control').length
|
2016-05-16 15:58:15 -04:00
|
|
|
|
2016-05-25 18:12:39 -04:00
|
|
|
$el.find('.fade-left').toggleClass('end-scroll', currentPosition is 0)
|
|
|
|
$el.find('.fade-right').toggleClass('end-scroll', currentPosition is maxPosition)
|