Sha256: 222f0c1d1946dcd6cbb80fcae7a1832a24fb85bbb90159c5eb46b59dc95908c3

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 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() {
      this.view = new App.Views.Main.Articles.Show({
        comment: new App.Models.Article.Comment({
          articleId: this.params.id
        })
      });
      this.view.render();
      this.connectWith([App.Models.Article.Comment]);
      App.Models.Article.find(this.params.id).then((function(_this) {
        return function(art) {
          console.log(art);
          return _this.view.renderArticle(art);
        };
      })(this));
      return App.Models.Article.Comment.all({
        articleId: this.params.id
      }, (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
          }, (function(_this) {
            return function(comment) {
              return _this.view.renderComments([comment]);
            };
          })(this));
      }
    };

    return Articles;

  })(App.Controllers.Base);

}).call(this);
:ET

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/EDIb3MUpznNBnEP-BVADgWo3qosIZqUxSk8iTkHZfiA.cache