Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

When uploading images directly from /refinery/images/new redirect bac…

…k to /refinery/images.
  • Loading branch information...
commit 9e0573a84f38cc598b9b1cde315d906949cdc048 1 parent 40b68ae
@ugisozols ugisozols authored
View
6 images/app/assets/javascript/refinery/images.js.coffee.erb
@@ -19,7 +19,6 @@ class Images
cache_dom: ->
@error_list = $("#error_list")
- @success_list = $("#flash")
@error_explanation = $("#errorExplanation")
@upload_progress = $("#upload_progress")
@@ -44,14 +43,15 @@ class Images
after_upload_all: ->
$(".save-loader").hide()
@upload_progress.hide()
- @success_list.show()
if @errors.length > 0
@render_errors()
else
if getParameterByName("modal") == "true"
window.parent.document.getElementById("dialog_frame").contentDocument.location.reload(true);
- else
+ else if getParameterByName("dialog") == "true"
window.parent.location.reload(true)
+ else
+ window.location = "<%= Refinery::Core::Engine.routes.url_helpers.admin_images_path %>"
validate: (file) ->
max_file_size = <%= Refinery::Images.max_image_size %>
View
10 images/app/controllers/refinery/admin/images_controller.rb
@@ -55,12 +55,10 @@ def create
unless params[:insert]
if @images.all?(&:valid?)
flash.notice = t('uploaded_successfully', :scope => 'refinery.admin.images.form')
- if from_dialog?
- @dialog_successful = true
- render :nothing => true, :layout => true
- else
- redirect_to refinery.admin_images_path
- end
+
+ @dialog_successful = true if from_dialog?
+
+ render :nothing => true, :layout => true
else
self.new # important for dialogs
render :action => 'new'
Please sign in to comment.
Something went wrong with that request. Please try again.