Sha256: 5a378dc97bd1f226fe85ad7f911ecdbbb5b59ce3f975f830bdae6c647e479f8c

Contents?: true

Size: 1.18 KB

Versions: 7

Compression:

Stored size: 1.18 KB

Contents

#= require ./list

#
# Marionette.js Layout Documentation
# https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.layout.md
#
@Character.Generic.Layout = Backbone.Marionette.LayoutView.extend
  className: 'chr-layout'

  template: -> "<div class='left'>
                  <header id=list_header class='chr-list-header'></header>
                  <div id=list_content class='chr-list'></div>
                </div>
                <div id=details class='right chr-logo'>
                </div>"

  regions:
    list_header:  '#list_header'
    list_content: '#list_content'
    details:      '#details'

  initialize: ->
    @ListHeaderView = @options.module.ListHeaderView
    @ListView       = @options.module.ListView
    @collection     = @options.module.collection

  onRender: ->
    @header = new @ListHeaderView(@options)
    @list   = new @ListView({ collection: @collection, module: @options.module })

    @list_header.show(@header)
    @list_content.show(@list)

  closeDetails: ->
    @list.unselectCurrentItem()
    @details.reset()

  updateListScope: (listScope, callback) ->
    @header.update(listScope)
    @collection.setScope(listScope).fetchPage(1, callback)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
character-1.0.6 app/assets/javascripts/character/generic/layout.coffee
character-1.0.5 app/assets/javascripts/character/generic/layout.coffee
character-1.0.4 app/assets/javascripts/character/generic/layout.coffee
character-1.0.3 app/assets/javascripts/character/generic/layout.coffee
character-1.0.2 app/assets/javascripts/character/generic/layout.coffee
character-1.0.1 app/assets/javascripts/character/generic/layout.coffee
character-1.0.0 app/assets/javascripts/character/generic/layout.coffee