spec/dummy/tmp/cache/assets/C21/BE0/sprockets%2F070263a383619079784e4ce15cf15443 in curate-0.1.3 vs spec/dummy/tmp/cache/assets/C21/BE0/sprockets%2F070263a383619079784e4ce15cf15443 in curate-0.2.0

- old
+ new

@@ -1,8 +1,8 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1366998624.5359578: @value"¶ {I" +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1367348144.6902251: @value" {I" class:ETI"ProcessedAsset;FI"logical_path;TI"manage_repeating_fields.js;FI" pathname;TI"Z/Users/jfriesen/Repositories/curate/app/assets/javascripts/manage_repeating_fields.js;FI"content_type;TI"application/javascript;TI" -mtime;TI"2013-04-19T13:36:17-04:00;TI" length;TipI" digest;TI"%85858ab2275749b340886ce72f01c357;FI" source;TI"p// This widget manages the adding and removing of repeating fields. +mtime;TI"2013-04-23T13:24:55-04:00;TI" length;Tiº I" digest;TI"%6c7312a9780a1b270452b63171ad6632;FI" source;TI"º // This widget manages the adding and removing of repeating fields. // There are a lot of assumptions about the structure of the classes and elements. // These assumptions are reflected in the MultiValueInput class. (function($){ $.widget( "curate.manage_fields", { @@ -35,20 +35,25 @@ var $activeField = $(event.target).parents('.field-wrapper'), $activeFieldControls = $activeField.children('.field-controls'), $removeControl = this.remover.clone(), $newField = $activeField.clone(), - $listing = $('.listing', this.element); - - $('.add', $activeFieldControls).remove(); - $activeFieldControls.prepend($removeControl); - - $newField.children('input').val(''); - $newField.children('input').focus() - $listing.append($newField); - - this._trigger("add"); + $listing = $('.listing', this.element), + $warningSpan = $("<span class=\'message warning\'>cannot add new empty field</span>"); + if ($activeField.children('input').val() == '') { + $listing.children('.warning').remove(); + $listing.append($warningSpan); + } + else{ + $listing.children('.warning').remove(); + $('.add', $activeFieldControls).remove(); + $activeFieldControls.prepend($removeControl); + $newField.children('input').val(''); + $newField.children('input').focus() + $listing.append($newField); + this._trigger("add"); + } }, remove_from_list: function( event ) { event.preventDefault(); @@ -64,7 +69,7 @@ $('.field-wrapper', this.element).removeClass("input-append"); this.element.removeClass( "managed" ); }, }); })(jQuery); -;TI"dependency_digest;TI"%378830460a90dfbaa2fd46d2ec6afbae;FI"required_paths;T[I"Z/Users/jfriesen/Repositories/curate/app/assets/javascripts/manage_repeating_fields.js;FI"dependency_paths;T[{I" path;TI"Z/Users/jfriesen/Repositories/curate/app/assets/javascripts/manage_repeating_fields.js;FI" -mtime;TI"2013-04-19T13:36:17-04:00;TI" digest;TI"%85858ab2275749b340886ce72f01c357;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F +;TI"dependency_digest;TI"%0198317ba81983d537cf6c0aeb7ed81b;FI"required_paths;T[I"Z/Users/jfriesen/Repositories/curate/app/assets/javascripts/manage_repeating_fields.js;FI"dependency_paths;T[{I" path;TI"Z/Users/jfriesen/Repositories/curate/app/assets/javascripts/manage_repeating_fields.js;FI" +mtime;TI"2013-04-23T13:24:55-04:00;TI" digest;TI"%6c7312a9780a1b270452b63171ad6632;FI" _version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F \ No newline at end of file