Sha256: a9ad1e65cb9af7441640e2b56d569bb6b5a9b46c6207a53113891024b1575b43
Contents?: true
Size: 1.99 KB
Versions: 36
Compression:
Stored size: 1.99 KB
Contents
{:uriI"file:///Users/khcr/Projets/Web/adeia/app/assets/javascripts/adeia/nested_form.js?type=application/javascript&pipeline=self&id=60d83f6283fa6b1ec72cf10d49eca684944a3ef97d437f2dc2c0993240bcbae0:ET:load_pathI"9/Users/khcr/Projets/Web/adeia/app/assets/javascripts;T: filenameI"N/Users/khcr/Projets/Web/adeia/app/assets/javascripts/adeia/nested_form.js;T: nameI"adeia/nested_form;T:logical_pathI"adeia/nested_form.self.js;T:content_typeI"application/javascript;T:sourceI"$(document).on("ready page:load", function() { $(".add-fields").click(function(e) { e.preventDefault(); var count = $(this).attr("data-count"), type = $(this).data("type"), lastFields = $("." + type + "-fields:last"), newFields = lastFields.clone(); count++; newFields.find("input, select") .attr("name", function( i, val ) { if(val) { return val.replace(/\d/, count) } }) .attr("id", function( i, val ) { if(val) { return val.replace(/\d/, count) } }) .val([]); newFields.find("label").attr("for", function( i, val ) { return val.replace(/\d/, count) }); newFields.insertAfter(lastFields); $(this).attr("data-count", count); newFields.show(); }); $(".fields-for").on("click", ".remove-fields", function(e) { e.preventDefault(); var type = $(this).attr("data-type"), fields = $(this).parents("." + type + "-fields"); fields.find("input[identifier=destroy]").val("1"); fields.hide(); }); }); ;T: metadata{:dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"\file-digest:///Users/khcr/Projets/Web/adeia/app/assets/javascripts/adeia/nested_form.js;TT: requiredo;;{ :stubbedo;;{ : linkso;;{ :charsetI" utf-8;F:digest"%9h@ƕWfM(*lFB^M:lengthi:dependencies_digest"%n:U}48N37Sjgsj5:idI"E60d83f6283fa6b1ec72cf10d49eca684944a3ef97d437f2dc2c0993240bcbae0;F: mtimel+x.V
Version data entries
36 entries across 36 versions & 1 rubygems