<commit_before>/**
 * The ListView control can be used to display a list of items to the user. If there is not enough space to display
 * the items, it will automatically use a scroll container.
 *
 * @example Simple usage
 * 	new ListView({
 * 	    items: myPersonDataArray,
 * 	    cellFactory: function(listView) {
 * 	    	return new Cell({
 * 	    	 updateItem: function(person) {
 * 	    	 	// release previous bindings
 * 					if(this._myBindings) this._myBindings.forEach(function(binding) { binding.dispose(); });
 * 					// create new bindings
 * 					this._myBindings = [
 * 						this.graphicsProperty.bind(person.pictureProperty),
 * 						this.textProperty.bind(person.fullNameProperty)
 * 					];
 * 	    	 }
 * 	    	});
 * 	    }
 * 	});
 *
 * @module jidejs/ui/control/ListView
 * @extends module:jidejs/ui/Control
 */
define([
	'jidejs/base/Class', 'jidejs/base/Observable', 'jidejs/base/ObservableProperty', 'jidejs/base/ObservableList', 'jidejs/ui/Control',
	'jidejs/ui/Skin', 'jidejs/ui/control/Cell', 'jidejs/ui/control/MultipleSelectionModel', 'jidejs/ui/Component',
	'jidejs/ui/Orientation', 'jidejs/base/Util', 'jidejs/base/DOM', 'jidejs/ui/register'
], function(
	Class, Var, Observable, ObservableList, Control, Skin, Cell, MultipleSelectionModel, Component, Orientation, _, DOM, register
) {
	//region ListViewSkin
	function ListViewSkin(listView, element) {
		Skin.call(this, listView, element);
	}
	Class(ListViewSkin).extends(Skin).def({
		defaultElement: 'ul',
		bindings: null,
		install: function() {
			var listView = this.component;
			this.bindings = [
				listView.items.on('change', function(event) {
					var changes = event.enumerator(),
						el = listView.element,
						i = 0, len = 0, child = null;
					while(changes.moveNext()) {<commit_msg>BUGFIX: ListView ignored the orientation when specified at initiation time.<commit_after>/**
 * The ListView control can be used to display a list of items to the user. If there is not enough space to display
 * the items, it will automatically use a scroll container.
 *
 * @example Simple usage
 * 	new ListView({
 * 	    items: myPersonDataArray,
 * 	    cellFactory: function(listView) {
 * 	    	return new Cell({
 * 	    	 updateItem: function(person) {
 * 	    	 	// release previous bindings
 * 					if(this._myBindings) this._myBindings.forEach(function(binding) { binding.dispose(); });
 * 					// create new bindings
 * 					this._myBindings = [
 * 						this.graphicsProperty.bind(person.pictureProperty),
 * 						this.textProperty.bind(person.fullNameProperty)
 * 					];
 * 	    	 }
 * 	    	});
 * 	    }
 * 	});
 *
 * @module jidejs/ui/control/ListView
 * @extends module:jidejs/ui/Control
 */
define([
	'jidejs/base/Class', 'jidejs/base/Observable', 'jidejs/base/ObservableProperty', 'jidejs/base/ObservableList', 'jidejs/ui/Control',
	'jidejs/ui/Skin', 'jidejs/ui/control/Cell', 'jidejs/ui/control/MultipleSelectionModel', 'jidejs/ui/Component',
	'jidejs/ui/Orientation', 'jidejs/base/Util', 'jidejs/base/DOM', 'jidejs/ui/register'
], function(
	Class, Var, Observable, ObservableList, Control, Skin, Cell, MultipleSelectionModel, Component, Orientation, _, DOM, register
) {
	//region ListViewSkin
	function ListViewSkin(listView, element) {
		Skin.call(this, listView, element);
	}
	Class(ListViewSkin).extends(Skin).def({
		defaultElement: 'ul',
		bindings: null,
		install: function() {
			var listView = this.component;
            if(listView.orientation === Orientation.HORIZONTAL) {
                listView.classList.add('jide-orientation-horizontal');
            } else {
                listView.classList.remove('jide-orientation-horizontal');
            }
			this.bindings = [
				listView.items.on('change', function(event) {
					var changes = event.enumerator(),
						el = listView.element,
						i = 0, len = 0, child = null;
					while(changes.moveNext()) {
{'fraction_non_alphanumeric': 0.13767370046320124, 'fraction_numerical': 0.001029336078229542, 'mean_word_length': 3.3723284589426323, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3490741', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1272, 'n_words': 260}