Permalink
Browse files

Remove deprecated getPath/setPath calls

Replaced with get and set - as per
emberjs/ember.js@859e157
8cfe3a6ec22
  • Loading branch information...
1 parent 0bd0ec5 commit db679e6f9beeb10c02447fc034da6eb6c0e9cfce @benalexander committed Jul 24, 2012
View
4 packages/ember-forms/lib/buttons.js
@@ -10,13 +10,13 @@ EF.SubmitButton = Ember.View.extend({
tagName: 'button',
attributeBindings: ['type'],
type: 'submit',
- name: Ember.computed(function(){ return this.getPath('parentView.submitName'); }),
+ name: Ember.computed(function(){ return this.get('parentView.submitName'); }),
template: Ember.Handlebars.compile("{{view.name}}")
});
EF.Buttons = Ember.ContainerView.extend({
classNames: ['buttons'],
childViews: [EF.SubmitButton],
form: Ember.computed(function(){ return findFormRecursively(this); }),
- submitName: Ember.computed(function(){ return this.getPath('form.submitName'); })
+ submitName: Ember.computed(function(){ return this.get('form.submitName'); })
});
View
6 packages/ember-forms/lib/fields/base.js
@@ -27,13 +27,13 @@ EF.BaseField = Ember.ContainerView.extend({
bindValue: function(){
var name = this.get('name');
var path = 'content.' + name;
- var value = this.getPath(path);
- this.set('value', this.getPath(path));
+ var value = this.get(path);
+ this.set('value', this.get(path));
},
data: Ember.computed(function(){
var data = {};
- data[this.get('name')] = this.getPath('inputView.value');
+ data[this.get('name')] = this.get('inputView.value');
return data;
}).volatile(),
View
22 packages/ember-forms/lib/fields/date.js
@@ -11,27 +11,27 @@ EF.DateComponent = Ember.ContainerView.extend({
value: Ember.computed(function(key, value){
var day, month, year;
if (arguments.length === 1){
- day = this.getPath('dayView.value');
- month = this.getPath('monthView.value');
- year = this.getPath('yearView.value');
+ day = this.get('dayView.value');
+ month = this.get('monthView.value');
+ year = this.get('yearView.value');
if(!e(day) && !e(month) && !e(year)){
return new Date(year, month, day, 12, 0, 0);
}
}else if(value){
day = value.getUTCDate() + '';
month = value.getUTCMonth() + '';
year = value.getUTCFullYear() + '';
- this.setPath('dayView.value', day);
- this.setPath('monthView.value', month);
- this.setPath('yearView.value', year);
+ this.set('dayView.value', day);
+ this.set('monthView.value', month);
+ this.set('yearView.value', year);
}
return value;
}).volatile(),
dayView: EF.UnboundSelect.extend({
attributeBindings: ['name'],
name: Ember.computed(function(){
- return this.getPath('parentView').get('name') + '_day';
+ return this.get('parentView').get('name') + '_day';
}),
prompt: "- Day -",
content: Ember.computed(function(){
@@ -47,7 +47,7 @@ EF.DateComponent = Ember.ContainerView.extend({
prompt: "- Month -",
attributeBindings: ['name'],
name: Ember.computed(function(){
- return this.getPath('parentView').get('name') + '_month';
+ return this.get('parentView').get('name') + '_month';
}),
content: Ember.computed(function(){
var months = Ember.A(["January", "February", "March", "April", "May",
@@ -63,7 +63,7 @@ EF.DateComponent = Ember.ContainerView.extend({
prompt: "- Year -",
attributeBindings: ['name'],
name: Ember.computed(function(){
- return this.getPath('parentView').get('name') + '_year';
+ return this.get('parentView').get('name') + '_year';
}),
content: Ember.computed(function(){
var years = [],
@@ -81,9 +81,9 @@ EF.DateField = EF.BaseField.extend({
InputView: EF.DateComponent.extend({}),
value: Ember.computed(function(key, value){
if(arguments.length === 1){
- return this.getPath('inputView.value');
+ return this.get('inputView.value');
}else{
- this.setPath('inputView.value', value);
+ this.set('inputView.value', value);
return value;
}
})
View
10 packages/ember-forms/lib/fields/select.js
@@ -3,18 +3,18 @@ require("ember-forms/fields/base");
EF.SelectField = EF.BaseField.extend({
InputView: Ember.Select.extend({
init: function(){
- var labelPath = this.getPath('field.optionLabelPath'),
- promptValue = this.getPath('field.prompt'),
- valuePath = this.getPath('field.optionValuePath');
+ var labelPath = this.get('field.optionLabelPath'),
+ promptValue = this.get('field.prompt'),
+ valuePath = this.get('field.optionValuePath');
if(labelPath){ this.set('optionLabelPath', 'content.' + labelPath); }
if(valuePath){ this.set('optionValuePath', 'content.' + valuePath); }
- if(promptValue){ this.set('prompt', this.getPath('field.prompt')); }
+ if(promptValue){ this.set('prompt', this.get('field.prompt')); }
this._super();
},
content: Ember.computed(function(){
- return this.getPath('field.content') || Ember.A([]);
+ return this.get('field.content') || Ember.A([]);
}).property('field.content')
})
});
View
2 packages/ember-forms/lib/form.js
@@ -29,7 +29,7 @@ EF.Form = Ember.View.extend({
isForm: true,
submitName: 'Save',
name: Ember.computed(function(){
- var constructor = this.getPath('content.constructor');
+ var constructor = this.get('content.constructor');
if(constructor && constructor.isClass){
var className = constructor.toString().split('.').pop();
return Ember.String.decamelize(className);
View
4 packages/ember-forms/lib/label.js
@@ -18,9 +18,9 @@ EF.Label = Ember.View.extend({
attributeBindings: ['for'],
template: Ember.Handlebars.compile("{{view.name}}"),
field: Ember.computed(function(){ return findFieldRecursively(this); }),
- form: Ember.computed(function(){ return this.getPath('field.formView'); }),
+ form: Ember.computed(function(){ return this.get('field.formView'); }),
name: Ember.computed(function(){
- return this.getPath('field.label') || this.getPath('field.name');
+ return this.get('field.label') || this.get('field.name');
}),
didInsertElement: function(){
// We bind it here to avoid re-rendering before the element was inserted

0 comments on commit db679e6

Please sign in to comment.