mirror of
https://github.com/fergalmoran/dss.git
synced 2026-02-03 22:55:33 +00:00
64 lines
2.0 KiB
JavaScript
Executable File
64 lines
2.0 KiB
JavaScript
Executable File
// Generated by CoffeeScript 1.6.2
|
|
(function() {
|
|
var __hasProp = {}.hasOwnProperty,
|
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
|
|
|
define(['marionette', 'models/comment/commentItem', 'views/comment/commentItemView', 'text!/tpl/CommentListView'], function(Marionette, CommentItem, CommentItemView, Template) {
|
|
var CommentListView, _ref;
|
|
|
|
CommentListView = (function(_super) {
|
|
__extends(CommentListView, _super);
|
|
|
|
function CommentListView() {
|
|
_ref = CommentListView.__super__.constructor.apply(this, arguments);
|
|
return _ref;
|
|
}
|
|
|
|
CommentListView.prototype.template = _.template(Template);
|
|
|
|
CommentListView.prototype.tagName = "ul";
|
|
|
|
CommentListView.prototype.className = "activity-listing media-list";
|
|
|
|
CommentListView.prototype.itemView = CommentItemView;
|
|
|
|
CommentListView.prototype.itemViewContainer = "#comment-list-container";
|
|
|
|
CommentListView.prototype.ui = {
|
|
commentText: '#comment-text'
|
|
};
|
|
|
|
CommentListView.prototype.events = {
|
|
"click #btn-add-comment": "addComment"
|
|
};
|
|
|
|
CommentListView.prototype.addComment = function() {
|
|
var _this = this;
|
|
|
|
console.log("CommentListView: addComment");
|
|
this.collection.create({
|
|
mix_id: this.collection.mix.get("id"),
|
|
comment: this.ui.commentText.val()
|
|
}, {
|
|
success: function(newItem) {
|
|
_this.ui.commentText.val("");
|
|
return true;
|
|
},
|
|
error: function(a, b, c) {
|
|
console.log(a);
|
|
console.log(b);
|
|
console.log(c);
|
|
return true;
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
return CommentListView;
|
|
|
|
})(Marionette.CompositeView);
|
|
return CommentListView;
|
|
});
|
|
|
|
}).call(this);
|