<commit_before>class Flaps
	constructor: () ->
		@getTabs()
		@setListeners()
		@current = 1;

	getTabs: () ->
		@tabheaders = document.querySelectorAll('.flap-title')
		@tabcontent = document.querySelectorAll('.flap')

	setListeners: () ->
		tab.addEventListener('click', @eventListener) for tab in @tabheaders

	eventListener: () ->
		item = @.dataset.itemPosition
<commit_msg>Adding the final parts to the event listener so that the tabs swap<commit_after>class Flaps
	constructor: () ->
		@getTabs()
		@setListeners()
		@current = 1;

	getTabs: () ->
		@tabheaders = document.querySelectorAll('.flap-title')
		@tabcontent = document.querySelectorAll('.flap')

	setListeners: () ->
		tab.addEventListener('click', @eventListener.bind(@)) for tab in @tabheaders

	eventListener: (e) ->
		item = e.toElement.dataset.itemPosition

		if item != @current
			current = document.querySelector('.flap:nth-of-type('+@current+')')
			newCurrent = document.querySelector('.flap:nth-of-type('+item+')')
			current.classList.add('flap-closed');
			newCurrent.classList.remove('flap-closed');
			@current = item
{'fraction_non_alphanumeric': 0.16363636363636364, 'fraction_numerical': 0.0018181818181818182, 'mean_word_length': 4.6461538461538465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3770379', 'n_tokens_mistral': 380, 'n_tokens_neox': 355, 'n_words': 68}