Skip to content

Commit

Permalink
Allows user to manage her subscribers. Fixes #605.
Browse files Browse the repository at this point in the history
  • Loading branch information
epicmonkey committed Aug 4, 2015
1 parent 44ea064 commit ab807b7
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions public/js/app/controllers/TimelineSubscribersController.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
define(["app/app",
define(["config",
"app/app",
"ember",
"controllers/ApplicationController"], function(App, Ember) {
"controllers/ApplicationController"], function(config, App, Ember) {
"use strict";

App.TimelineSubscribersController = App.ApplicationController.extend({
isEdit: false,
App.TimelineSubscribersController = App.ApplicationController.extend({
isEdit: false,

actions: {
removeSubscriber: function(username) {
},
actions: {
removeSubscriber: function(user) {
Ember.$.ajax({
url: config.host + '/v1/users/' + user.get('username') + '/unsubscribeFromMe',
type: 'post',
context: this
})
.then(function(response) {
this.get('model').removeObject(user)
})
},

manage: function() {
this.set('isEdit', true)
},
manage: function() {
this.set('isEdit', true)
},

browse: function() {
this.set('isEdit', false)
}
}
browse: function() {
this.set('isEdit', false)
}
}
})
})

0 comments on commit ab807b7

Please sign in to comment.