-
Notifications
You must be signed in to change notification settings - Fork 0
/
services_view.coffee
32 lines (25 loc) · 959 Bytes
/
services_view.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CollectionView = require 'chaplin/views/collection_view'
ServiceView = require './service_view'
template = require './templates/services'
module.exports = class ServicesView extends CollectionView
template: template
autoRender: true
tagName: 'div' # This is not directly a list but contains a list
id: 'services'
containerSelector: '#content-container'
listSelector: '.services' # Append the item views to this element
fallbackSelector: '.fallback'
initialize: ->
super # Will render the list itself and all items
# The most important method a class inheriting from CollectionView
# must overwrite.
getView: (item) ->
# Instantiate an item view
new ServiceView model: item
render: ->
console.log 'ServicesView#render', this, @$el
super
# @$('.tweets, .tweets-header').css 'display', 'block'
afterRender: ->
super
console.log 'ServicesView#afterRender', @containerSelector, $(@containerSelector)