<commit_before>import {Directive, OnInit, AfterViewChecked} from 'angular2/core';
import {ElementRef} from 'angular2/core';
import {Renderer} from 'angular2/core';

@Directive({
	selector: '[parallax]',
	inputs: [],
	host: {}
})

export class ParallaxDirective implements OnInit, AfterViewChecked {
	headerHeight: number = 0;

	constructor(private _elRef: ElementRef, private _renderer: Renderer) {
		ParallaxDirective.MOBILE_WIDTH = 760;
		ParallaxDirective.windowWidth = jQuery(window).width(); 

		_renderer.listenGlobal('window', 'scroll', (event) => {
			this._onScroll(); // Scroll event handler
		});
	}

	ngOnInit() {
		const _windowWidth = ParallaxDirective.windowWidth;
		const _MOBILE_WIDTH = ParallaxDirective.MOBILE_WIDTH;

		/* Next/prev and primary nav btn click handlers */
		jQuery('a.main').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: 0
			}, 1000, function() { });
			return false;
		});
		jQuery('a.experience').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#experience').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.skills').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#skills').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.training').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#training').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.languages').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#languages').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.contact').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#contact').offset().top
			}, 1000, function() { });
			return false;
		});
	}

	ngAfterViewChecked() {

		/* Main Menu */
		jQuery('body #menu-icon').click(function(event) {
			event.preventDefault();
			jQuery('#main-nav').fadeToggle();
			jQuery('#wrapper #top-nav').hide();
			jQuery(this).toggleClass('active');
		});

	
		/* Show/hide dot lav labels on hover */
		jQuery('nav#primary a').hover(
			function() {
				jQuery(this).prev('h1').show();
			},
			function() {
				jQuery(this).prev('h1').hide();
			}
		);

		this.init();	
    }

	private initFixedHeader() {
		let headerHeight = jQuery('#header hgroup').outerHeight() - jQuery('#nav-bar').outerHeight();<commit_msg>change menu events from ngOnAfterViewChecked() to ngOnInit()<commit_after>import {Directive, OnInit, AfterViewChecked} from 'angular2/core';
import {ElementRef} from 'angular2/core';
import {Renderer} from 'angular2/core';

@Directive({
	selector: '[parallax]',
	inputs: [],
	host: {}
})

export class ParallaxDirective implements OnInit, AfterViewChecked {
	headerHeight: number = 0;

	constructor(private _elRef: ElementRef, private _renderer: Renderer) {
		ParallaxDirective.MOBILE_WIDTH = 760;
		ParallaxDirective.windowWidth = jQuery(window).width(); 

		_renderer.listenGlobal('window', 'scroll', (event) => {
			this._onScroll(); // Scroll event handler
		});
	}

	ngOnInit() {
		const _windowWidth = ParallaxDirective.windowWidth;
		const _MOBILE_WIDTH = ParallaxDirective.MOBILE_WIDTH;

		/* Main Menu */
		jQuery('body #menu-icon').click(function(event) {
			event.preventDefault();
			jQuery('#main-nav').fadeToggle();
			jQuery('#wrapper #top-nav').hide();
			jQuery(this).toggleClass('active');
		});


		/* Show/hide dot lav labels on hover */
		jQuery('nav#primary a').hover(
			function() {
				jQuery(this).prev('h1').show();
			},
			function() {
				jQuery(this).prev('h1').hide();
			}
		);

		/* Next/prev and primary nav btn click handlers */
		jQuery('a.main').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: 0
			}, 1000, function() { });
			return false;
		});
		jQuery('a.experience').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#experience').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.skills').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#skills').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.training').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#training').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.languages').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#languages').offset().top
			}, 1000, function() { });
			return false;
		});
		jQuery('a.contact').click(function() {
			hideMenu(_windowWidth, _MOBILE_WIDTH);
			jQuery('html, body').animate({
				scrollTop: jQuery('#contact').offset().top
			}, 1000, function() { });
			return false;
		});
	}

	ngAfterViewChecked() {
		this.init();	
    }

	private initFixedHeader() {
		let headerHeight = jQuery('#header hgroup').outerHeight() - jQuery('#nav-bar').outerHeight();
{'fraction_non_alphanumeric': 0.18249396023044043, 'fraction_numerical': 0.012637056309236202, 'mean_word_length': 4.365902293120638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4711148', 'n_tokens_mistral': 2031, 'n_tokens_neox': 1706, 'n_words': 315}