Sha256: 9fc2082e89919dad7f3e10bc3bf5d978f7e65fb59b5bd070b013f0bc6fd4f742

Contents?: true

Size: 1.78 KB

Versions: 3

Compression:

Stored size: 1.78 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(article) {
          return _this.view.renderArticle(article);
        };
      })(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

3 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/PND_EuNN34MT-0GF4KaT2Itny6hjtRDGRPHIqR5FLdo.cache
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/Qtkn9DJMepYKYO55D71ItXQkMoBRzACK_7RrSDSC-qk.cache
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/rPc-HVIKi4cbnP-PYrwpyzq9pOL3AnoGTejPkpygJSo.cache