Tidy up controller code
This commit is contained in:
Родитель
dda6ac0604
Коммит
7e1c9a7f58
|
@ -1,4 +1,3 @@
|
|||
HighFidelity.EpisodeController = Ember.ObjectController.extend({
|
||||
// Implement your controller here.
|
||||
// Implement your controller here.
|
||||
});
|
||||
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
HighFidelity.EpisodeEditController = Ember.ObjectController.extend({
|
||||
needs: 'episode',
|
||||
actions: {
|
||||
save: function(){
|
||||
self = this
|
||||
this.get('buffer').forEach(function(attr){
|
||||
self.get('controllers.episode.model').set(attr.key, attr.value);
|
||||
});
|
||||
this.transitionToRoute('episode',this.get('model'));
|
||||
}
|
||||
}
|
||||
});
|
||||
needs: 'episode',
|
||||
actions: {
|
||||
save: function(){
|
||||
var _this = this;
|
||||
|
||||
this.get('buffer').forEach(function(attr) {
|
||||
_this.get('controllers.episode.model')
|
||||
.set(attr.key, attr.value);
|
||||
});
|
||||
|
||||
this.transitionToRoute('episode',this.get('model'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
HighFidelity.PodcastEditController = Ember.ObjectController.extend({
|
||||
needs: 'podcast',
|
||||
|
||||
actions: {
|
||||
save: function(){
|
||||
self = this
|
||||
this.get('buffer').forEach(function(attr){
|
||||
self.get('controllers.podcast.model').set(attr.key, attr.value);
|
||||
save: function() {
|
||||
var _this = this;
|
||||
|
||||
this.get('buffer').forEach(function(attr) {
|
||||
_this.get('controllers.podcast.model')
|
||||
.set(attr.key, attr.value);
|
||||
});
|
||||
|
||||
this.transitionToRoute('podcast', this.get('model'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,3 @@
|
|||
HighFidelity.PodcastsController = Ember.ObjectController.extend({
|
||||
// Implement your controller here.
|
||||
// setupController: function() {
|
||||
// this.store.createRecord('podcast', {
|
||||
// id: 1,
|
||||
// rssURL: 'http://atp.fm/episodes?format=rss',
|
||||
// lastUpdated: (new Date()),
|
||||
// lastPlayed: (new Date()),
|
||||
// coverImageURL: 'http://static.squarespace.com/static/513abd71e4b0fe58c655c105/ t/52c45a37e4b0a77a5034aa84/1388599866232/1500w/Artwork.jpg',
|
||||
// episodes: []
|
||||
// });
|
||||
// this.store.save();
|
||||
// }
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче