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.5.3 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.5.2 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.5.1 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.5.0 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.12 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.11 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.10 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.9 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.8 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.7 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.6 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.5 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.4 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.3 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.4.2 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.24 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.23 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.22 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.20 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee
it-logica-application-backbone-1.3.19 app/assets/javascripts/backbone_js/ladas_jstree_methods.js.coffee