Created
July 15, 2010 17:02
-
-
Save joegaudet/477212 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addComment: function(source){ | |
console.log("Add Coment!"); | |
var commentBox = source.getPath('parentView.parentView'); | |
var body = commentBox.getPath('commentControl.content.value'); | |
var feedItem = commentBox.get('feedItem'); | |
var user = DarkHorse.store.find(DarkHorse.User,DarkHorse.currentUser.get('guid')); | |
var comment = DarkHorse.store.createRecord(DarkHorse.Comment,{ | |
body: body, | |
user: user, | |
feedItem: feedItem | |
}); | |
feedItem.get('comments').addInverseRecord(comment); | |
user.get('comments').addInverseRecord(comment); | |
commentBox.setPath('commentControl.content.value',""); | |
DarkHorse.store.commitRecords(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment