<commit_before>/* Animate views */

var transitionend = 'transitionend oTransitionEnd webkitTransitionEnd';

$(document).on(transitionend, '.animate', function() {
	$(this).dequeue();
});

function transition($el) {
	// check if transition duration > 0, otherwise finish animation
	parseFloat($el.css('transition-duration')) || $el.dequeue();
}

function enter() {
	$(this).addClass('animate enter');

	// force redraw
	this.offsetHeight;

	transition($(this).addClass('active').removeClass('leave'));
}

function done(next) {
	$(this).removeClass('animate enter active');
	next();
}

function leave() {
	$(this).addClass('animate leave');

	// force redraw
	this.offsetHeight;

	transition($(this).addClass('active').removeClass('enter'));
}

// remove element when transition ends
function remove(next) {
	$(this).remove();
	next();
}

$.fn.extend({

	enter: function(element, method) {
		return this.queue(function(next) {
			$(element)[method || 'append'](this);
			next();
		}).queue(enter).queue(done);
	},

	leave: function() {
		return this.stop().queue([leave, remove]);
	}
});<commit_msg>Enabled animating to height: auto by explicitly setting height on element after it has been inserted.<commit_after>/* Animate views */

var transitionend = 'transitionend oTransitionEnd webkitTransitionEnd';

$(document).on(transitionend, '.animate', function() {
	$(this).dequeue();
});

function transition($el) {
	// check if transition duration > 0, otherwise finish animation
	parseFloat($el.css('transition-duration')) || $el.dequeue();
	// TODO set timeout or similar to prevent broken transitions from dequeuing
}

function enter() {
	$(this).addClass('animate enter');

	// force redraw
	this.offsetHeight;

	transition($(this).addClass('active').removeClass('leave'));
}

function done(next) {
	$(this).removeClass('animate enter active');
	next();
}

function leave() {
	$(this).addClass('animate leave');

	// force redraw
	this.offsetHeight;

	transition($(this).addClass('active').removeClass('enter'));
}

// remove element when transition ends
function remove(next) {
	$(this).remove();
	next();
}

$.fn.extend({

	enter: function(element, method, animateHeight) {
		return this.queue(function(next) {
			$(element)[method || 'append'](this);
			next();
		}).queue(function(next) {
			if(animateHeight)
				$(this).css('height', this.scrollHeight);
			next();
		}).queue(enter).queue(done);
	},

	leave: function() {
		return this.stop().queue([leave, remove]);
	}
});
{'fraction_non_alphanumeric': 0.185334407735697, 'fraction_numerical': 0.0008058017727639, 'mean_word_length': 5.176616915422885, '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': '4968483', 'n_tokens_mistral': 778, 'n_tokens_neox': 737, 'n_words': 172}