Fix announcement preview for IE
This commit is contained in:
parent
d98faba129
commit
b1c6f288e8
|
@ -4,17 +4,22 @@ $(function() {
|
||||||
|
|
||||||
var preview_url = $(this).attr('url');
|
var preview_url = $(this).attr('url');
|
||||||
|
|
||||||
$("form.previewable").ajaxSubmit({
|
for ( instance in CKEDITOR.instances )
|
||||||
beforeSubmit: function(a,f,o){
|
CKEDITOR.instances[instance].updateElement();
|
||||||
o.dataType = 'script';
|
|
||||||
o.url = preview_url;
|
var formData = new FormData( $('form.previewable')[0] );
|
||||||
o.type = 'post';
|
|
||||||
},success: function(msg) {
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: preview_url,
|
||||||
|
data : formData,
|
||||||
|
processData: false,
|
||||||
|
contentType: false
|
||||||
|
}).done(function(data){
|
||||||
|
$('#show_preview').html(data);
|
||||||
$('#show_preview .modal').modal()
|
$('#show_preview .modal').modal()
|
||||||
$('#show_preview .modal').height(function() {
|
$('#show_preview .modal').height(($(window).height() * 0.7));
|
||||||
return $(window).height() * 0.7;
|
|
||||||
});
|
});
|
||||||
}});
|
|
||||||
});
|
});
|
||||||
$(".preview_trigger").click(function(){
|
$(".preview_trigger").click(function(){
|
||||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||||
|
|
|
@ -1,9 +1 @@
|
||||||
<% if !request.xhr? %>
|
<%= render :partial=>"/shared/preview/modal_preview" %>
|
||||||
<textarea>
|
|
||||||
<% end %>
|
|
||||||
$('#show_preview').html('<%=escape_javascript(render :partial=>"/shared/preview/modal_preview") %>');
|
|
||||||
<!-- var start_modal_with_id = "<%= @preview_obj.id %>"; -->
|
|
||||||
<!-- $("#"+start_modal_with_id).modal(); -->
|
|
||||||
<% if !request.xhr? %>
|
|
||||||
</textarea>
|
|
||||||
<% end %>
|
|
Loading…
Reference in New Issue