{:uriI"file://vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee?type=application/javascript&pipeline=self&id=77ebe714532767ed56a36ea53cdf08e61d8b7f57be89b82531fc074fb8d526f7:ET:load_pathI"Kvendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/assets/javascripts;T: filenameI"svendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee;T: nameI"%rails_admin/ra.nested-form-hooks;T:logical_pathI"-rails_admin/ra.nested-form-hooks.self.js;T:content_typeI"application/javascript;T: sourceI"h (function() { var $; $ = jQuery; $(document).ready(function() { return window.nestedFormEvents.insertFields = function(content, assoc, link) { var tab_content; tab_content = $(link).closest(".controls").siblings(".tab-content"); tab_content.append(content); return tab_content.children().last(); }; }); $(document).on('nested:fieldAdded', 'form', function(content) { var controls, field, nav, new_tab, one_to_one, parent_group, toggler; field = content.field.addClass('tab-pane').attr('id', 'unique-id-' + (new Date().getTime())); new_tab = $('
  • ' + field.children('.object-infos').data('object-label') + '
  • '); parent_group = field.closest('.control-group'); controls = parent_group.children('.controls'); one_to_one = controls.data('nestedone') !== void 0; nav = controls.children('.nav'); content = parent_group.children('.tab-content'); toggler = controls.find('.toggler'); nav.append(new_tab); $(window.document).trigger('rails_admin.dom_ready', [field, parent_group]); new_tab.children('a').tab('show'); if (!one_to_one) { nav.select(':hidden').show('slow'); } content.select(':hidden').show('slow'); toggler.addClass('active').removeClass('disabled').children('i').addClass('icon-chevron-down').removeClass('icon-chevron-right'); if (one_to_one) { return controls.find('.add_nested_fields').removeClass('add_nested_fields').html(field.children('.object-infos').data('object-label')); } }); $(document).on('nested:fieldRemoved', 'form', function(content) { var add_button, controls, current_li, field, nav, one_to_one, parent_group, toggler; field = content.field; nav = field.closest(".control-group").children('.controls').children('.nav'); current_li = nav.children('li').has('a[href=#' + field.attr('id') + ']'); parent_group = field.closest(".control-group"); controls = parent_group.children('.controls'); one_to_one = controls.data('nestedone') !== void 0; toggler = controls.find('.toggler'); (current_li.next().length ? current_li.next() : current_li.prev()).children('a:first').tab('show'); current_li.remove(); if (nav.children().length === 0) { nav.select(':visible').hide('slow'); toggler.removeClass('active').addClass('disabled').children('i').removeClass('icon-chevron-down').addClass('icon-chevron-right'); } if (one_to_one) { add_button = toggler.next(); return add_button.addClass('add_nested_fields').html(add_button.data('add-label')); } }); }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"|file-digest://vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/app/assets/javascripts/rails_admin/ra.nested-form-hooks.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%MUD p^p]`~}7: lengthih :dependencies_digest"%qA>A7WŀpMPaqn5":idI"E77ebe714532767ed56a36ea53cdf08e61d8b7f57be89b82531fc074fb8d526f7;F: mtimel+eV