Commit efd10d8dcd39b49a51def898dbed12a8d471d884
1 parent
1c1a6c38
Exists in
master
and in
29 other branches
[media-panel-improvements] Insert uploaded media before the others
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/views/cms/media_upload.js.erb
1 | 1 | <% if @file.valid? %> |
2 | 2 | <% klass = @file.class.name.split('::').last.to_css_class %> |
3 | - jQuery("#published-media .items .<%= klass.pluralize %>").append("<%= j render :partial => "cms/media_panel/#{klass}" %>"); | |
3 | + jQuery("#published-media .items .<%= klass.pluralize %> h3").after("<%= j render :partial => "cms/media_panel/#{klass}" %>"); | |
4 | 4 | jQuery("#published-media .items .<%= klass.pluralize %>").show(); |
5 | 5 | <% else %> |
6 | 6 | alert("Failed to upload file: <%= j @file.errors.full_messages.join(', ').html_safe %>"); | ... | ... |