Sha256: f50d57713a3f1d41d2e608f610d67089be70e9f8c8a443a5e7e79fb04ab9177c

Contents?: true

Size: 773 Bytes

Versions: 31

Compression:

Stored size: 773 Bytes

Contents

class App.Controllers.Main.Pages extends App.Controllers.Base
  index: ->
    @view = new App.Views.Main.Pages.ArticleList
    @view.render()
    this.connectWith [App.Models.Article, App.Models.Article.Comment]
    App.Models.Article.get('all', page: 1).then (resp) => @view.renderArticles resp.resources

  receivedSignal: (signal, data) ->
    switch signal
      when 'Article published'
        App.Models.Article.find(id: data.id, abbr: true).then (article) => @view.renderNewArticle article
      when 'Article updated'
        @view.updateArticle data.id
      when 'Article.Comment created'
        @view.commentsQuantityChangedForArticle data.article_id, 1
      when 'Article.Comment destroyed'
        @view.commentsQuantityChangedForArticle data.article_id, -1

Version data entries

31 entries across 27 versions & 1 rubygems

Version Path
loco-rails-3.0.3 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-3.0.3 test/dummy/node_modules/loco-js/spec_coffee/dummy/controllers/main/pages.coffee
loco-rails-2.5.3 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.5.2 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-3.0.2 test/dummy/node_modules/loco-js/spec_coffee/dummy/controllers/main/pages.coffee
loco-rails-3.0.2 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-3.0.1 test/dummy/node_modules/loco-js/spec_coffee/dummy/controllers/main/pages.coffee
loco-rails-3.0.1 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.5.1 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.5.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.4.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.3.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-3.0.0 test/dummy/node_modules/loco-js/spec_coffee/dummy/controllers/main/pages.coffee
loco-rails-3.0.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.2.2 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.2.1 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.2.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.1.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-2.0.0 test/dummy/app/assets/javascripts/controllers/main/pages.coffee
loco-rails-1.5.2 test/dummy/app/assets/javascripts/controllers/main/pages.coffee