Sha256: a7ff7f9b3221ce209b9d502c389a53b44ba1a50f1c0683f6908d0aff6b6aa277

Contents?: true

Size: 1.46 KB

Versions: 7

Compression:

Stored size: 1.46 KB

Contents

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

  template: -> """<aside class='left'>
                    <header class='chr-list-header'>
                      <span class='title'>Settings</span>
                    </header>
                    <div id=list_content class='chr-list'>
                      <ul id=list></ul>
                    </div>
                  </aside>
                  <div id=details class='right chr-logo'></div>"""

  regions:
    details: '#details'

  ui:
    list:          '#list'
    user_email:    '#user_email'
    action_logout: '.browserid_logout'

  onRender: ->
    submodules = @options.module.submodules

    @ui.action_logout.attr('href', chr.options.url + '/logout')
    @ui.user_email.html(chr.options.user_email)

    # add left menu options
    _.each submodules, (m) =>
      title = m.options.titleMenu
      name  = m.options.moduleName
      @ui.list.append """<li class='chr-list-item'>
                           <a href='#/settings/#{ name }' class='#{ name }'><div class='title'>#{ title }</div></a>
                         </li>"""

  unsetActiveMenuItem: ->
    @ui.list.find('.active').removeClass('active')

  setActiveMenuItem: (path) ->
    @unsetActiveMenuItem()
    @ui.list.find("a.#{ path }").parent().addClass('active')

Version data entries

7 entries across 7 versions & 1 rubygems

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