<commit_before>
/**
 * UI Component Drag
 * @class UI.Component.Drag
 * @author <NAME>
 */
define([
	
], function(

) {

	var exports = new Class({

		/**
		 * Display options for container
		 * @type {Object} options
		 */
		options: {
			display: {
				fx: {
					default: {
						duration: 160,
					    transition: 'sine:out',
					    link: 'cancel'
					},
					minimize: {
						duration: 160,
					    transition: 'sine:out',
					    link: 'cancel'
					}
				}
			}
		},

		/**
		 * [_initDisplay description]
		 * @return {[type]} [description]
		 */
		_initDisplay: function() {
	 		//_log.debug('_initDisplay', this.element);

	 		this._modifier = 'width';

	 		var direction = this.container.getStyle('flex-direction');

			if (direction === 'column') {
				this._modifier = 'height';
			}

			//_log.debug('direction', direction, this._modifier);

			var self = this;
			var	opts = this.options.display;
			var	fx = opts.fx.default;
			var	modifier = this._modifier;

			if (!this[modifier]) {
				this[modifier] = this.options.size || 260;
			}

			this.device = this.device || 'desktop';
			//this.underlay.hide();
			this.display = {};

			fx.property = modifier;

			this.display.fx = new Fx.Tween(this.element, fx)
			.addEvent('complete', function() {
				self.fireEvent('toggled');
			});

			return this.display;
		},

		/**
		 * [getDisplay description]
		 * @return {[type]} [description]
		 */
		getDisplay: function() {

			return this._display;
		},

		/**
		 * [getDisplay description]
		 * @return {[type]} [description]
		 */
		setDisplay: function(display) {

			this._display = display;

			return this;
		},

		/**
		 * [toggle description]
		 * @return {[type]} [description]
		 */
		toggle: function() {
			console.log('toggle', this._display);
			//_log.debug('__toggle click, display', this._display);

			if (this._display === 'normalized'){
				this.minimize();
			} else {
				this.normalize();
			}

			return this._display;
		},

		close: function() {
			this.minimize();
		},

		/**
		 * [minimize description]
		 * @return {[type]} [description]
		 */
		minimize: function(quiet) {
			//_log.debug('------start minimalization', this.device);
			var self = this;	
			if (!this.display) {
				this._initDisplay();
			}

			this.fireEvent('minimize');

			if (quiet) {
				this.element.setStyle(this._modifier, 0);
			} else {
				this.display.fx.start(0);
			}

			this._display = 'minimized';
			console.log('display', this._display);

			if (this.underlay && this.device != 'desktop') {
				this.underlay.fade(0);
			}

			this.fireEvent('display', 'minimized');
		},

		/**
		 * [normalize description]
		 * @return {[type]} [description]
		 */
		normalize: function() {
			console.log('normalize');
			if (!this.display) {<commit_msg>update container display<commit_after>
/**
 * UI Component Drag
 * @class UI.Component.Drag
 * @author <NAME>
 */
define([
	
], function(

) {

	var exports = new Class({

		/**
		 * Display options for container
		 * @type {Object} options
		 */
		options: {
			display: {
				fx: {
					default: {
						duration: 160,
					    transition: 'sine:out',
					    link: 'cancel'
					},
					minimize: {
						duration: 160,
					    transition: 'sine:out',
					    link: 'cancel'
					}
				}
			}
		},

		/**
		 * [_initDisplay description]
		 * @return {[type]} [description]
		 */
		_initDisplay: function() {
	 		//_log.debug('_initDisplay', this.element);

	 		this._modifier = 'width';

	 		var direction = this.container.getStyle('flex-direction');

			if (direction === 'column') {
				this._modifier = 'height';
			}

			//_log.debug('direction', direction, this._modifier);

			var self = this;
			var	opts = this.options.display;
			var	fx = opts.fx.default;
			var	modifier = this._modifier;

			if (!this[modifier]) {
				this[modifier] = this.options.size || 260;
			}

			this.device = this.device || 'desktop';
			//this.underlay.hide();
			this.display = {};

			fx.property = modifier;

			this.display.fx = new Fx.Tween(this.element, fx)
			.addEvent('complete', function() {
				self.fireEvent('toggled');
			});

			return this.display;
		},

		/**
		 * [getDisplay description]
		 * @return {[type]} [description]
		 */
		getDisplay: function() {

			return this._display;
		},

		/**
		 * [getDisplay description]
		 * @return {[type]} [description]
		 */
		setDisplay: function(display) {

			this._display = display;

			return this;
		},

		/**
		 * [toggle description]
		 * @return {[type]} [description]
		 */
		toggle: function() {
			//console.log('toggle', this._display);
			//_log.debug('__toggle click, display', this._display);

			if (this._display === 'normalized'){
				this.minimize();
			} else {
				this.normalize();
			}

			return this._display;
		},

		close: function() {
			this.minimize();
		},

		/**
		 * [minimize description]
		 * @return {[type]} [description]
		 */
		minimize: function(quiet) {
			//_log.debug('------start minimalization', this.device);
			var self = this;	
			if (!this.display) {
				this._initDisplay();
			}

			this.fireEvent('minimize');

			if (quiet) {
				this.element.setStyle(this._modifier, 0);
			} else {
				this.display.fx.start(0);
			}

			this._display = 'minimized';
			//console.log('display', this._display);

			if (this.underlay && this.device != 'desktop') {
				this.underlay.fade(0);
			}

			this.fireEvent('display', 'minimized');
		},

		/**
		 * [normalize description]
		 * @return {[type]} [description]
		 */
		normalize: function() {
			//console.log('normalize');
			if (!this.display) {
{'fraction_non_alphanumeric': 0.1770926689370855, 'fraction_numerical': 0.004301846208998029, 'mean_word_length': 2.574631646380525, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2982715', 'n_tokens_mistral': 2394, 'n_tokens_neox': 1813, 'n_words': 364}