Commit f7b0b7d237c850a7f4885d8740d357998fe6fea4

Authored by Karpikau Andrei
1 parent b9bf9884

check file delete

... ... @@ -149,6 +149,12 @@ jQuery(document).ready(function(){
149 149
150 150
151 151 $this.fileinput(options);
  152 +
  153 + $this.on('fileclear', function(event) {
  154 + var $input = $("<input />", {type: 'hidden', name: $this.attr('name'), value: ''});
  155 + $selector.append($input);
  156 + });
  157 +
152 158 });
153 159
154 160 clearAjaxFileUpload($('#work_area .editor-content'));
... ...
... ... @@ -10,7 +10,9 @@
10 10 <% end %>
11 11 <% if form2.object.get_marker_type(@type_content) == 'file' %>
12 12 <% s3_direct_post = S3_BUCKET.presigned_post(key: "#{form2.object.get_file_path}${filename}", success_action_status: '201', acl: 'public-read') %>
  13 +
13 14 <%= form2.file_field :text_value, :class => "fileupload-field", 'data-url' => s3_direct_post.url, 'data-form-data' => s3_direct_post.fields.to_json, 'data-host' => URI.parse(s3_direct_post.url).host , 'data-type' => 'zip' %>
  15 +
14 16 <% if form2.object.text_value.present? %>
15 17 <div class="preview">
16 18 <% if Kanjai::PageContentMarker.image?(form2.object.text_value) %>
... ...