Skip to content

Commit

Permalink
modifications for issue #54
Browse files Browse the repository at this point in the history
  • Loading branch information
AnujaK committed Dec 13, 2014
1 parent 60b97c5 commit bde2e9f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/main/resources/static/js/views/star-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,19 @@ define(function (require) {
$(this).removeClass('active');
})
this.$el.addClass("active");
console.log('Starred Node Id : ' + this.$el.find('a').data('data-star-id'))
console.log('Starred Node Id : ' + this.$el.find('a').data('data-star-id'));

var node = new NodeModel({
id : this.$el.find('a').data('data-star-id')
id : this.model.id
});
node.fetch({
success : function(response) {
console.log(response.get("conversation"));
var conversation = new ConversationModel(
response.get("conversation"));
var conversation = new ConversationModel(response.get("conversation"));
conversation.set("name", response.get("name"));
conversation.set("description",response.get("description"));
// var conversationView = new
// app.ConversationView({model : conversation});
APP.conversation.render(conversation);
ConversationEvents.triggerChange(response
.get("conversation") ? response
.get("conversation").id : null);
ConversationEvents.triggerChange(response.get("conversation") ? response.get("conversation").id : null);
}
});
//ProjectEvents.triggerChange(this.$el.find('a').data('project-id'));
Expand Down
26 changes: 25 additions & 1 deletion src/main/resources/static/js/views/tagged-node-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,35 @@ define(function(require) {
var Backbone = require('backbone');
var _ = require('underscore');

var ConversationEvents = require('events/conversation-event');

var NodeModel = require('models/node');
var ConversationModel = require('models/conversation');

var TaggedNodeListItemView = Backbone.View.extend({
tagName : 'li',
template: _.template($('#tpl-tagged-node-list-item').html()),

events : {
"click a" : "showConversation"
},

showConversation : function(){
var node = new NodeModel({
id : this.model.id
});
node.fetch({
success : function(response) {
console.log(response.get("conversation"));
var conversation = new ConversationModel(response.get("conversation"));
conversation.set("name", response.get("name"));
conversation.set("description",response.get("description"));
APP.conversation.render(conversation);
ConversationEvents.triggerChange(response.get("conversation") ? response.get("conversation").id : null);
}
});

},

render : function(eventName) {
this.$el.html(this.template({node: this.model}));
return this;
Expand Down

0 comments on commit bde2e9f

Please sign in to comment.