Commit c2c4424ff82a4325129a3d14a4d18099a368050c

Authored by Steven Verbeek
1 parent 597afb7c

Started note attachment changes, and text changes

app/assets/javascripts/note.js
@@ -38,8 +38,9 @@ init: @@ -38,8 +38,9 @@ init:
38 }); 38 });
39 39
40 $("#note_attachment").change(function(e){ 40 $("#note_attachment").change(function(e){
41 - var val = $('input[type=file]').val(); 41 + var val = $('.input-file').val();
42 var filename = val.substr(val.lastIndexOf("/")); 42 var filename = val.substr(val.lastIndexOf("/"));
  43 + console.log(filename,val);
43 $(".file_name").text(filename); 44 $(".file_name").text(filename);
44 }); 45 });
45 46
app/views/notes/_form.html.haml
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 %h5 Attachment: 25 %h5 Attachment:
26 .clearfix 26 .clearfix
27 .attachments.breadcrumb 27 .attachments.breadcrumb
28 - %span.file_name File name... 28 + %div.file_name File name...
29 %button.file_upload.btn.primary Upload File 29 %button.file_upload.btn.primary Upload File
30 .input= f.file_field :attachment, :class => "input-file" 30 .input= f.file_field :attachment, :class => "input-file"
31 %span Any file less then 10 MB 31 %span Any file less then 10 MB