diff --git a/app/views/answers/_status.html.erb b/app/views/answers/_status.html.erb index 4405d65..cc86ddd 100644 --- a/app/views/answers/_status.html.erb +++ b/app/views/answers/_status.html.erb @@ -2,12 +2,8 @@ -<% if answer.updated_at.blank? %> -

- <%= _('Not answered yet') %> -

-<% else %> +<% if answer.updated_at.present? %>

- <%= _('Answered')%> <%= answer.updated_at.iso8601 %><%= _(' by')%> <%= answer.user.name %> + <%= _('Answered')%> <%= answer.updated_at.iso8601 %><%= _(' by')%> <%= answer.user.name %>

<% end %> \ No newline at end of file diff --git a/lib/assets/javascripts/views/answers/status.js b/lib/assets/javascripts/views/answers/status.js index 822a4e7..374fd31 100644 --- a/lib/assets/javascripts/views/answers/status.js +++ b/lib/assets/javascripts/views/answers/status.js @@ -13,12 +13,6 @@ */ const showSavingMessage = selector => $(selector).closest('.question-form').find('.saving-message').show(); /* - * Hides the closest not-answered HTML element within a question-form - * @param { String } selector - A valid CSS selector to look for - * @return { jQuery } - */ - const hideNotAnswered = selector => $(selector).closest('.question-form').find('.not-answered').hide(); - /* * Retrieves the question id for the closest form-answer * @param { String } selector - A valid CSS selector to look for * @return { String } representing the question id for a given answer, otherwise undefined @@ -42,9 +36,6 @@ Tinymce.init({ selector: '.tinymce_answer' }); // Listeners for change, blur and focus at any target element with class tinymce_answer Tinymce.findEditorsByClassName('tinymce_answer').forEach((editor) => { - editor.on('Change', () => { - hideNotAnswered(`#${editor.id}`); - }); editor.on('Blur', () => { const id = questionId(`#${editor.id}`); $(`#${editor.id}`).val(editor.getContent()); // Updates target element of editor with its content @@ -67,7 +58,6 @@ }); // Listener for input or select field $('.form-answer').on('change', 'input, select', (e) => { - hideNotAnswered(e.target); const id = questionId(e.target); if (!debounceMap[id]) { debounceMap[id] = debounce(autoSaving);