Sha256: a45e37da35d240ea594dd920b330196bb674cc21393f7ca9e3541365efc4b7d8

Contents?: true

Size: 678 Bytes

Versions: 17

Compression:

Stored size: 678 Bytes

Contents

$(function() {
  $('.tree').on('click', '.toggle', function(e) {
    e.preventDefault();
    var $li   = $(this).parents('li:first');
    var $icon = $li.find('.icon.toggle');
    var $nested = $li.find('.nested');

    if ($icon.hasClass('expanded')) {
      $icon.removeClass('expanded');
      $nested.slideUp(); 
    }
    else {
      var contentUrl = $nested.data('ajax-content');
      $li.addClass('loading');
      
      $nested.load(contentUrl, function() {
        $nested.find('li:last').addClass('branch_end');
        $icon.addClass('expanded');
        init_tooltips();
        $nested.slideDown(); 
        $li.removeClass('loading');
      });
    }
  });
});

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
refinerycms-core-4.0.3 app/assets/javascripts/refinery/tree.js
refinerycms-core-4.0.2 app/assets/javascripts/refinery/tree.js
refinerycms-core-4.0.1 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.6 app/assets/javascripts/refinery/tree.js
refinerycms-core-4.0.0 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.5 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.4 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.3 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.2 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.1 app/assets/javascripts/refinery/tree.js
refinerycms-core-3.0.0 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.5 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.4 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.3 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.2 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.1 app/assets/javascripts/refinery/tree.js
refinerycms-core-2.1.0 app/assets/javascripts/refinery/tree.js