jejacks0n/mercury — Issue #145: Custom image insert not working in Firefox
Author: shreyas-satish
Created: 2012-01-24 06:19:01+00:00
State: open

I've defined a custom behavior for a button in my mercury.js as follows :

imageUpload: function(selection) {
Mercury.modal('/admin/assets/image_upload', {
title: 'Upload Image',
fullHeight: false,
handler: 'imageUploader'
});
},

In the image_upload.html.erb view I have an Ajax form that accepts a image. I'm able to get the file upload to work through ajax using the remotipart gem. After the image submit the following view (create.js.erb) is rendered

attrs = {src: "http://localhost:3000" + "<%=@picture.image.url%>"};
Mercury.trigger('action', {action: 'insertImage', value: attrs});
Mercury.modal.hide();

The image is inserted properly into the editable area, in Chrome but __not__ inserted in Firefox. The Firebug Console does not report any errors.

I'm using Mercury 0.2.3 & Rails 3.2.0 (An additional note, this problem persists even when using Rails 3.1.3)