Sha256: 37769e41df94916b9d9a1578613ed405813a301cc3fa2963c31a5ec0a26b22da

Contents?: true

Size: 1.99 KB

Versions: 42

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=f47514b6fbf588911269446c2c34f6533f4ea792157e7c9b65d118ba1f7bd951: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@ƕWfM(*lFB^M:lengthi:dependencies_digest"%tN&a;{w}3	Y(`3[j:idI"Ef47514b6fbf588911269446c2c34f6533f4ea792157e7c9b65d118ba1f7bd951;F:
mtimel+x.V

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
adeia-0.12.0 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.11 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.10 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.9 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.8 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.7 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.6 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.5 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.4 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.3 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.2 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.11.0 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.5 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.4 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.3 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.2 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.1 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.10.0 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.9.2 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache
adeia-0.9.1 spec/test_app/tmp/cache/assets/development/sprockets/v3.0/HZqviA8DlanTXFBdHFZVNGaxiLgsUZQf9N8rbqJG70c.cache