<commit_before>/**
 * Provides Form and input features.
 *
 * @module furnace
 * @submodule furnace-forms
 */
import Ember from 'ember';
import Control from './abstract';


/**
 * Input control component proxy 
 * 
 * @class Input
 * @namespace Furnace.Forms.Controls
 * @extends Furnace.Forms.Controls.Abstract
 * @protected
 */
export default Control.extend({
	_component : 'view',
	
	_componentType : 'view',
	
	init : function() {
		this._super();
		// If we do not have a name, we're an anonymous option without a counterpart in
		if(this.get('_name')!==null) {
			var propertyName='_panel.for.'+this.get('_name');
			
			var property=this.get('_panel.for.');
			if(property instanceof DS.ManyArray) {
				this.reopen({
					value: Ember.computed('_panel.for,_panel.for.@each',function() {
						return this.get('_panel.for').objectAt(this._name);
					})
				});
			}
			else {
				this.reopen({
					value:Ember.computed.alias(propertyName)
				});
			}
		}			
	},


<commit_msg>Fixed view should only get model value when not set<commit_after>/**
 * Provides Form and input features.
 *
 * @module furnace
 * @submodule furnace-forms
 */
import Ember from 'ember';
import Control from './abstract';


/**
 * Input control component proxy 
 * 
 * @class Input
 * @namespace Furnace.Forms.Controls
 * @extends Furnace.Forms.Controls.Abstract
 * @protected
 */
export default Control.extend({
	_component : 'view',
	
	_componentType : 'view',
	
	init : function() {
		this._super();
		// If we do not have a name, we're an anonymous option without a counterpart in
		if(this.get('_name')!==null && this.value===undefined) {
			var propertyName='_panel.for.'+this.get('_name');
			
			var property=this.get('_panel.for.');
			if(property instanceof DS.ManyArray) {
				this.reopen({
					value: Ember.computed('_panel.for,_panel.for.@each',function() {
						return this.get('_panel.for').objectAt(this._name);
					})
				});
			}
			else {
				this.reopen({
					value:Ember.computed.alias(propertyName)
				});
			}
		}			
	},



{'fraction_non_alphanumeric': 0.15324165029469547, 'fraction_numerical': 0.0, 'mean_word_length': 3.270440251572327, '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': '475452', 'n_tokens_mistral': 774, 'n_tokens_neox': 646, 'n_words': 150}