<commit_before>////////////////////////////////////////////////////////////////////////////////
// General Dropdown Control
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, window */
var app = app || {};

app.controls = function (controls, $) {
	var
	
	// static event handlers
	onClick;
	
	controls.dropdown = function () {
		var self = controls.control.create(),
				popup = null,
				caption = '';
			
		//////////////////////////////
		// Getters / setters

		self.caption = function (value) {
			caption = value;
			return self;
		};

		self.popup = function (value) {
			popup = value;
			return self;
		};

		//////////////////////////////
		// Overrides

		self.init = function (elem) {
			elem.find('button')
				.click(function (event) {
					onClick.call(this, event, popup);
					return false;
				});
		};
		
		self.html = function () {
			return [
				'<span id="', self.id, '" class="dropdown">',
				'<button type="button">',
				'<span class="caption">', caption, '</span>',
				'<span class="indicator"></span>',
				'</button>',
				'</span>'
			].join('');
		};
		
		return self;<commit_msg>dropdown control doesn't throw error on unspecified popup<commit_after>////////////////////////////////////////////////////////////////////////////////
// General Dropdown Control
////////////////////////////////////////////////////////////////////////////////
/*global jQuery, window */
var app = app || {};

app.controls = function (controls, $) {
	var
	
	// static event handlers
	onClick;
	
	controls.dropdown = function () {
		var self = controls.control.create(),
				popup = null,
				caption = '';
			
		//////////////////////////////
		// Getters / setters

		self.caption = function (value) {
			caption = value;
			return self;
		};

		self.popup = function (value) {
			popup = value;
			return self;
		};

		//////////////////////////////
		// Overrides

		self.init = function (elem) {
			elem.find('button')
				.click(function (event) {
					if (popup) {
						onClick.call(this, event, popup);
					}
					return false;
				});
		};
		
		self.html = function () {
			return [
				'<span id="', self.id, '" class="dropdown">',
				'<button type="button">',
				'<span class="caption">', caption, '</span>',
				'<span class="indicator"></span>',
				'</button>',
				'</span>'
			].join('');
		};
		
		return self;
{'fraction_non_alphanumeric': 0.3301255230125523, 'fraction_numerical': 0.0, 'mean_word_length': 1.4127144298688195, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1544064', 'n_tokens_mistral': 814, 'n_tokens_neox': 635, 'n_words': 156}