Skip to content

Commit bde2e9f

Browse files
committed
modifications for issue #54
1 parent 60b97c5 commit bde2e9f

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

src/main/resources/static/js/views/star-view.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,19 @@ define(function (require) {
2525
$(this).removeClass('active');
2626
})
2727
this.$el.addClass("active");
28-
console.log('Starred Node Id : ' + this.$el.find('a').data('data-star-id'))
28+
console.log('Starred Node Id : ' + this.$el.find('a').data('data-star-id'));
2929

3030
var node = new NodeModel({
31-
id : this.$el.find('a').data('data-star-id')
31+
id : this.model.id
3232
});
3333
node.fetch({
3434
success : function(response) {
3535
console.log(response.get("conversation"));
36-
var conversation = new ConversationModel(
37-
response.get("conversation"));
36+
var conversation = new ConversationModel(response.get("conversation"));
3837
conversation.set("name", response.get("name"));
3938
conversation.set("description",response.get("description"));
40-
// var conversationView = new
41-
// app.ConversationView({model : conversation});
4239
APP.conversation.render(conversation);
43-
ConversationEvents.triggerChange(response
44-
.get("conversation") ? response
45-
.get("conversation").id : null);
40+
ConversationEvents.triggerChange(response.get("conversation") ? response.get("conversation").id : null);
4641
}
4742
});
4843
//ProjectEvents.triggerChange(this.$el.find('a').data('project-id'));

src/main/resources/static/js/views/tagged-node-view.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,35 @@ define(function(require) {
44
var Backbone = require('backbone');
55
var _ = require('underscore');
66

7+
var ConversationEvents = require('events/conversation-event');
8+
9+
var NodeModel = require('models/node');
10+
var ConversationModel = require('models/conversation');
711

812
var TaggedNodeListItemView = Backbone.View.extend({
913
tagName : 'li',
1014
template: _.template($('#tpl-tagged-node-list-item').html()),
11-
15+
events : {
16+
"click a" : "showConversation"
17+
},
18+
19+
showConversation : function(){
20+
var node = new NodeModel({
21+
id : this.model.id
22+
});
23+
node.fetch({
24+
success : function(response) {
25+
console.log(response.get("conversation"));
26+
var conversation = new ConversationModel(response.get("conversation"));
27+
conversation.set("name", response.get("name"));
28+
conversation.set("description",response.get("description"));
29+
APP.conversation.render(conversation);
30+
ConversationEvents.triggerChange(response.get("conversation") ? response.get("conversation").id : null);
31+
}
32+
});
33+
34+
},
35+
1236
render : function(eventName) {
1337
this.$el.html(this.template({node: this.model}));
1438
return this;

0 commit comments

Comments
 (0)