Skip to content

Commit

Permalink
Merge pull request #61 from thefrontside/remove-blockless-form
Browse files Browse the repository at this point in the history
Remove blockless form
  • Loading branch information
Robdel12 committed Aug 11, 2015
2 parents 488b5ae + 9dfe6b7 commit 0567f79
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 514 deletions.
63 changes: 0 additions & 63 deletions addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,6 @@ export default Ember.Component.extend({
*/
tabindex: 0,

/**
* Auxiliary computed property that replaces `content.`
* in `optionValuePath`.
*
* @private
* @property _valuePath
*/
_valuePath: Ember.computed('optionValuePath', function() {
var optionValuePath = this.get('optionValuePath');
if (optionValuePath) {
return optionValuePath.replace(/^content\.?/, '');
}
return null;
}),

/**
* Auxiliary computed property that replaces `content.`
* in `optionLabelPath`.
*
* @private
* @property _labelPath
*/
_labelPath: Ember.computed('optionLabelPath', function() {
var optionLabelPath = this.get('optionLabelPath');

if (optionLabelPath) {
return optionLabelPath.replace(/^content\.?/, '');
}
return null;
}),

/**
* Alias to `value`.
* This way we accept `value` or `selection` properties.
Expand All @@ -102,38 +71,6 @@ export default Ember.Component.extend({
*/
placeholder: Ember.computed.alias('prompt'),

/**
* Auxiliary computed array that holds `content` array
* values and their labels. Used only in the blockless version.
*
* @private
* @property _optionValues
*/
_optionValues: Ember.computed('_labelPath', '_valuePath', 'content.[]', function() {
var content = this.get('content') || [];
return content.map((object) => {
var label;
var value = object;
var valuePath = this.get('_valuePath');
var labelPath = this.get('_labelPath');

if (valuePath) {
value = Ember.get(object, valuePath);
}

if (labelPath) {
label = Ember.get(object, labelPath);
} else {
label = value;
}

return {
value: value,
label: label
};
});
}),

/**
* The collection of options for this select box. When options are
* inserted into the dom, they will register themselves with their
Expand Down
11 changes: 1 addition & 10 deletions app/templates/components/x-select.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{{#if hasBlock}}
{{yield}}
{{else}}
{{#if placeholder}}
<option>{{placeholder}}</option>
{{/if}}
{{#each _optionValues as |option|}}
{{#x-option value=option.value}}{{option.label}}{{/x-option}}
{{/each}}
{{/if}}
{{yield}}
87 changes: 0 additions & 87 deletions tests/acceptance/x-select-multiple-blockless-test.js

This file was deleted.

104 changes: 0 additions & 104 deletions tests/acceptance/x-select-single-blockless-option-value-test.js

This file was deleted.

93 changes: 0 additions & 93 deletions tests/acceptance/x-select-single-blockless-test.js

This file was deleted.

14 changes: 0 additions & 14 deletions tests/dummy/app/controllers/blockless-multiple.js

This file was deleted.

Loading

0 comments on commit 0567f79

Please sign in to comment.