Sha256: c5ef1080803af14441832d5d4b60254bf2b613bdb5839ee95b0532a10073ae3f

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

window.file_tree =
  bind_event_on_buttons: ->
    ($ '.collapsed').each (index, element) ->
      ($ element).bind 'click', ->
        file_tree.handle_button element
  handle_button: (domId) ->
    if ($ domId).hasClass "collapsed"
      ($ domId).removeClass "collapsed"
      ($ domId).addClass "expanded"
      ($ domId).text '-'
      file_tree.show_folder domId
    else
      ($ domId).removeClass "expanded"
      ($ domId).addClass "collapsed"
      ($ domId).text '+'
      file_tree.hide_folder domId

  show_folder: (button_domId) ->
    ($ button_domId).parent().parent().children('.nested_folder').each (index, element) ->
      ($ element).show()
    ($ button_domId).parent().parent().children('.files').each (index, element) ->
      ($ element).show()


  hide_folder: (button_domId) ->
    ($ button_domId).parent().parent().children('.nested_folder').each (index, element) ->
      ($ element).hide()
    ($ button_domId).parent().parent().children('.files').each (index, element) ->
      ($ element).hide()

jQuery ($) ->
  file_tree.bind_event_on_buttons()

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
watch_tower-0.0.3 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.2 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1.beta12 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1.beta11 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1.beta10 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1.beta9 lib/watch_tower/server/assets/javascripts/file_tree.coffee
watch_tower-0.0.1.beta8 lib/watch_tower/server/assets/javascripts/file_tree.coffee