diff --git a/app/assets/javascripts/note.js b/app/assets/javascripts/note.js index 9e5d35a2..eb69bb4c 100644 --- a/app/assets/javascripts/note.js +++ b/app/assets/javascripts/note.js @@ -38,8 +38,9 @@ init: }); $("#note_attachment").change(function(e){ - var val = $('input[type=file]').val(); + var val = $('.input-file').val(); var filename = val.substr(val.lastIndexOf("/")); + console.log(filename,val); $(".file_name").text(filename); }); diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index 2d92005d..10545f58 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -25,7 +25,7 @@ %h5 Attachment: .clearfix .attachments.breadcrumb - %span.file_name File name... + %div.file_name File name... %button.file_upload.btn.primary Upload File .input= f.file_field :attachment, :class => "input-file" %span Any file less then 10 MB