Clicking "Preview" does nothing when creating a comment on a research note.
What happened just before the problem occurred
When creating a new comment on a research note the "Preview" button does not show a preview of the note or do anything at all.
When editing an existing comment, it seems to work as it has in the past (the edit window is replaced with a display of the rendered markdown).
Relevant URLs
https://publiclab.org/notes/LaPa/03-31-2016/raspberry-noir-cam-sensors-to-detect-water-stress-of-the-plants-during-their-growing
PublicLab.org username
cfastie
Browser, version, and operating system
Chrome, Windows 10
I am interested in giving this a go. @Zanibas and I will update if we have any progess.
Oh, that's super. Thank you and please ask if you have questions or need tips on existing code organization! The code for the preview button is at:
https://github.com/publiclab/plots2/tree/master/app/views/comments/_form.html.erb#L88
and it's duplicated at:
https://github.com/publiclab/plots2/tree/master/app/views/comments/_edit.html.erb#L124
Although this needn't be part of your fix, perhaps the JavaScript code in these files should eventually be consolidated in a file at /app/assets/javascripts/comments.js and then included using <%= javascript_include_tag "comments" %> instead of being inline. I may open an issue for this as well.
Thanks again!
Oh, and to be specific, the code in _edit.html.erb is what's shown when editing an existing comment, whereas _form.html.erb is shown in the form for new comments.
This isn't Happening now. Confirmed at the same link given above. We can perhaps write a javascript test later for this. The JavaScript label will be reminder for that. Closing this for now.