app/controllers/neofiles/admin_controller.rb in neofiles-1.2.2 vs app/controllers/neofiles/admin_controller.rb in neofiles-1.3.0
- old
+ new
@@ -105,10 +105,11 @@
file_objects << file
end
result = []
file_objects.each_with_index do |file, i|
- result << file_compact(data.merge(id: file.id, widget_id: "#{data[:widget_id]}_ap_#{i}", append_create: i == file_objects.count - 1 && !old_file && data[:append_create] == '1' ? '1' : '0'))
+ append_create_position = Rails.application.config.neofiles.album_append_create_side == :left ? i == 0 : i == file_objects.count - 1
+ result << file_compact(data.merge(id: file.id, widget_id: "#{data[:widget_id]}_ap_#{i}", append_create: append_create_position && !old_file && data[:append_create] == '1' ? '1' : '0'))
end
if result.empty?
raise ArgumentError.new(last_exception || (errors.empty? ? I18n.t('neofiles.file_not_passed') : errors.join("\n")))
end
\ No newline at end of file