Sha256: fbfd2562f76fcf2dfecc9a5980285268a4bbd91d0ea8f1d733dce953bb7e315f

Contents?: true

Size: 1015 Bytes

Versions: 3

Compression:

Stored size: 1015 Bytes

Contents

class JstreeMethods
  @check_tree: (selector) ->
    $(selector + " li").each (index, element) =>
      if ($(element).hasClass("active"))
        $(element).children("ul").each (index, element) =>
          JstreeMethods.show($(element))
      else
        $(element).children("ul").each (index, element) =>
          JstreeMethods.hide($(element))
  @toggle_level: (element) ->
    if $(element).parent("li").hasClass("jstree-open")
      JstreeMethods.hide($(element).next("ul"))
    else
      JstreeMethods.show($(element).next("ul"))

  ############### private ##########3

  @show: (element) ->
    element.show()
    element.parent("li").removeClass("jstree-closed")
    element.parent("li").addClass("jstree-open")
    element.parent("li").children("button").html("-")

  @hide: (element) ->
    element.hide()
    element.parent("li").removeClass("jstree-open")
    element.parent("li").addClass("jstree-closed")
    element.parent("li").children("button").html("+")


window.JstreeMethods = JstreeMethods

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
it-logica-application-backbone-1.0.26 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.0.25 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.0.24 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee