Up scroll integration

/**
 * Modified on scroll event
 */
var position = $( window ).scrollTop();

function scrollUp() {
	var scroll = $( window ).scrollTop();

	if ( scroll > 600 ) {
		if ( scroll > position ) {
			$( '.pt-goto-sticky' ).removeClass( 'is-visible' );
		} else {
			$( '.pt-goto-sticky' ).addClass( 'is-visible' );
		}
	} else {
		$( '.pt-goto-sticky' ).removeClass( 'is-visible' );	
	}

	position = scroll;
}

scrollUp();

var scrolling = false;

$( window ).on( 'scroll', function() {
	scrolling = true;
} );

setInterval( function() {
	if ( scrolling ) {
		scrolling = false;

		scrollUp();
	}
}, 200 );