Sha256: e3fa1fbb34179e1df051f50dff0dd52b46538d027c27e651c19eec265292727d

Contents?: true

Size: 1.06 KB

Versions: 101

Compression:

Stored size: 1.06 KB

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("fast")
    element.parent("li").removeClass("jstree-closed")
    element.parent("li").addClass("jstree-open")
    element.parent("li").children("button").html('<i class="icon-minus-sign"></i>')

  @hide: (element) ->
    element.hide("fast")
    element.parent("li").removeClass("jstree-open")
    element.parent("li").addClass("jstree-closed")
    element.parent("li").children("button").html('<i class="icon-plus-sign"></i>')


window.JstreeMethods = JstreeMethods

Version data entries

101 entries across 101 versions & 1 rubygems

Version Path
it-logica-application-backbone-1.3.18 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.17 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.16 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.15 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.14 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.13 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.12 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.11 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.10 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.9 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.8 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.7 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.6 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.5 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.4 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.3 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.2 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.1 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.0 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.2.32 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee