Sha256: 3d0126cb287382b3a7d0068c4031ffa7c555eff9d924a7851241b2e1eaa33055
Contents?: true
Size: 2 KB
Versions: 7
Compression:
Stored size: 2 KB
Contents
I"ñ(function() { var extend = 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; }, hasProp = {}.hasOwnProperty; App.Controllers.Main.Articles = (function(superClass) { extend(Articles, superClass); function Articles() { return Articles.__super__.constructor.apply(this, arguments); } Articles.prototype.show = function() { var newComment; newComment = new App.Models.Article.Comment({ articleId: this.params.id }); this.view = new App.Views.Main.Articles.Show({ comment: newComment }); this.view.render(); this.connectWith([App.Models.Article.Comment]); App.Models.Article.find(this.params.id).then((function(_this) { return function(article) { return _this.view.renderArticle(article); }; })(this)); App.Models.Article.Comment.get("count").then((function(_this) { return function(res) { return console.log(res); }; })(this)); return App.Models.Article.Comment.all({ articleId: this.params.id }).then((function(_this) { return function(comments) { return _this.view.renderComments(comments); }; })(this)); }; Articles.prototype.receivedSignal = function(signal, data) { switch (signal) { case 'Article.Comment created': if (data.article_id !== this.params.id) { return; } return App.Models.Article.Comment.find({ id: data.id, articleId: data.article_id }).then((function(_this) { return function(comment) { return _this.view.renderComments([comment]); }; })(this)); } }; return Articles; })(App.Controllers.Base); }).call(this); :ET
Version data entries
7 entries across 7 versions & 1 rubygems