Sha256: d96d11e31973e9112305b8a79e3880326f7b0903c04205211b21b48d045c7d25

Contents?: true

Size: 434 Bytes

Versions: 6

Compression:

Stored size: 434 Bytes

Contents

class Admin.Views.DropdownToggle extends Backbone.View

  el: '.dropdown-toggle'

  events:
    'click .trigger': 'initClick'

  initClick: (e) =>
    e.preventDefault()
    if $(e.target).hasClass('trigger')
      trigger = $(e.target)
    else
      trigger = $(e.target).parents('.trigger')
    trigger.toggleClass('active')
    trigger.children('i').toggleClass('icon-arrow-down icon-arrow-up')
    trigger.siblings('ul').toggle()

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cambium-0.3.0 lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee
cambium-0.2.2 lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee
cambium-0.2.1 lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee
cambium-0.2.0 lib/generators/cambium/templates/app/assets/javascripts/admin/views/dropdown_toggle.js.coffee
cambium-0.0.2 lib/generators/cambium/templates/app/assets/javascripts/admin/backbone/views/dropdown_toggle.js.coffee
cambium-0.0.1 lib/generators/cambium/templates/app/assets/javascripts/admin/backbone/views/dropdown_toggle.js.coffee