Sha256: 5c18dfe466a8a37802f319515685c4793615441d05ac7912a46d471378cb48b9
Contents?: true
Size: 792 Bytes
Versions: 6
Compression:
Stored size: 792 Bytes
Contents
$(document).ready -> $('#upload').click -> $('#upload-file').click() $('#upload-file').change -> $('.waiting').css 'display', 'block' $('#upload-form').submit() return return renderImg() return ready_post = -> # Display the image to be uploaded. $('.photo-upload').on 'change', (e) -> readURL(this); readURL = (input) -> if (input.files && input.files[0]) reader = new FileReader() reader.onload = (e) -> $('.image-to-upload').attr('src', e.target.result).removeClass('hidden'); $swap = $('.swap') if $swap $swap.removeClass('hidden') $('.files').addClass('files-absolute') reader.readAsDataURL(input.files[0]); $(document).ready(ready_post) $(document).on('turbolinks:load', ready_post)
Version data entries
6 entries across 6 versions & 1 rubygems