Sha256: 5b3be0adb80b4bfaefd1b696abfb1636afb8f0d896b681226be876ddbb142e19

Contents?: true

Size: 757 Bytes

Versions: 19

Compression:

Stored size: 757 Bytes

Contents

Backbone.Poised.List ||= {}
class Backbone.Poised.List.Anchor extends Backbone.Poised.View
  tagName: 'li'
  className: 'anchor'

  events:
    'click': 'toggleCollapse'

  initialize: (options = {}) ->
    super
    @name = options.name or 'general'
    @label = options.label

    @collapsible = options.collapsible is true
    @collapsed = options.collapsed isnt false if @collapsible

  toggleCollapse: =>
    @$el.toggleClass('collapsed')

  render: ->
    if @name is 'undefined'
      defaultLocale = 'other'
    else
      defaultLocale = @name.toLabel()
    @$el.html @loadLocale "listAnchors.#{@name}.label",
      defaultValue: defaultLocale

    if @collapsible
      @$el.addClass('collapsible')
      @toggleCollapse() if @collapsed

    this

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ela-4.1.6 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.5 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.4 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.3 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.2 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.1 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.1.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-4.0.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.4.3 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.4.2 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.4.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.3.1 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.3.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.2.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.1.1 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.1.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-3.0.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-2.0.0 app/js/vendor/backbone.poised/list/anchor.coffee
ela-1.1.0 app/js/vendor/backbone.poised/list/anchor.coffee