<commit_before>define(['jquery'],function($) {

	return {

		settings: {
			$accordion: $('.accordion'),
			$tab: $('.accordion__tab'),
			$panel: $('.accordion__panel')
		},

		init: function() {
			var _ = this;

			_.bindKeyEvents();
			_.bindAriaEvents();
			_.initClickEvent();
		},

		initClickEvent: function() {
			var _ = this;

			_.settings.$tab.off().on('click keydown', function(e) {
				$clickedTab = $(this);

				if ( e.type == 'click' || e.keyCode == 13 || e.keyCode == 32 ) { 
					$clickedTab.next('.accordion__panel').slideToggle(300);
					$clickedTab.children('.accordion__icon').toggleClass('open');

					if ( $clickedTab.children('.accordion__icon').hasClass('open') ){
						$panel = $clickedTab.next('.accordion__panel');
						_.setAriaVisible($clickedTab);
						_.getNextFocusable($panel);
					} else {
						_.setAriaHidden($clickedTab);
					} 
				} else if ( e.keyCode == 39 || e.keyCode == 40 ) {
					var $id = '#' + $clickedTab.parents('.accordion').attr('id') + ' .accordion__tab';
					var index = $($id).index(document.activeElement) + 1;
					if (index >= $($id).length) index = 0;
					$($id).eq(index).focus();
					}
  			});
		},

		bindKeyEvents: function() {
			var _ = this;
		},

		bindAriaEvents: function() {
			var _ = this;

			$(_.settings.$accordion).each(function(i){
				var $this = $(this);
				$this.attr('id', 'accordion_' + i);

				_.setDefaultAriaAttributes($this, i);
			});
		},

		setDefaultAriaAttributes: function($this, i) {<commit_msg>up and right keys move through accordion, working on CTRL + up functionality<commit_after>define(['jquery'],function($) {

	return {

		settings: {
			$accordion: $('.accordion'),
			$tab: $('.accordion__tab'),
			$panel: $('.accordion__panel')
		},

		init: function() {
			var _ = this;

			_.bindKeyEvents();
			_.bindAriaEvents();
			_.initClickEvent();
		},

		initClickEvent: function() {
			var _ = this;
			let keys = [];

			_.settings.$tab.off().on('click keydown', function(e) {
				let $clickedTab = $(this);
				keys[e.keyCode] = true;
				console.log(keys);

				if ( e.type == 'click' || keys[13] || keys[32] ) { 
					$clickedTab.next('.accordion__panel').slideToggle(300);
					$clickedTab.children('.accordion__icon').toggleClass('open');

					if ( $clickedTab.children('.accordion__icon').hasClass('open') ){
						$panel = $clickedTab.next('.accordion__panel');
						_.setAriaVisible($clickedTab);
						// _.getNextFocusable($panel);
					} else {
						_.setAriaHidden($clickedTab);
					} 
				}
				// functionality for 'up' or 'left' arrow keys 
				else if ( keys[37] || keys[38] ) {
					var $id = '#' + $clickedTab.parents('.accordion').attr('id') + ' .accordion__tab';
					var index = $($id).index(document.activeElement) - 1;
					if (index >= $($id).length) index = 0;
					$($id).eq(index).focus();
				} 
				// functionality for 'down' or 'right' keys
				else if ( keys[39] || keys[40] ) {
					var $id = '#' + $clickedTab.parents('.accordion').attr('id') + ' .accordion__tab';
					var index = $($id).index(document.activeElement) + 1;
					if (index >= $($id).length) index = 0;
					$($id).eq(index).focus();
				} 
				// functionality for 'CTRL' + 'up' arrow key
				else if ( keys[17] == true && keys[38] == true ) {
					alert('hi');
				}
  			});

  			_.settings.$tab.on('keyup', function(e) {
  				keys[e.keyCode] = false;
  			})
		},

		bindKeyEvents: function() {
			var _ = this;
		},

		bindAriaEvents: function() {
			var _ = this;

			$(_.settings.$accordion).each(function(i){
				var $this = $(this);
				$this.attr('id', 'accordion_' + i);

				_.setDefaultAriaAttributes($this, i);
			});
		},

		setDefaultAriaAttributes: function($this, i) {
{'fraction_non_alphanumeric': 0.20242587601078166, 'fraction_numerical': 0.009703504043126684, 'mean_word_length': 3.024945770065076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '6703033', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1273, 'n_words': 225}