Commit 7090814d authored by Joenio Costa's avatar Joenio Costa

add loading indicator on comments

parent 8b41531d
Pipeline #171411587 failed with stages
in 1 minute and 57 seconds
......@@ -45,3 +45,5 @@
<div class='reply-comment-form hidden'></div>
</li>
<script>submit_form_loading_done();</script>
......@@ -48,6 +48,7 @@
DEFAULT_LOADING_MESSAGE = <%="'#{ _('loading...') }'".html_safe %>;
PERMANENT_NOTIFICATIONS = <%= @environment.permanent_notifications %>;
noosfero.profile = <%= (@profile.identifier if @profile).to_json.html_safe %>
submit_form_loading_done();
</script>
<% if current_editor_is?(Article::Editor::TINY_MCE) %>
......
......@@ -1203,8 +1203,23 @@ function update_image(input_field) {
img_name.html($(input_field).val().split('\\').pop())
}
var submit_form_loading = null;
function submit_form(element) {
$(element).css('background-image', 'url(/images/loading-small.gif)');
$(element).css('background-repeat', 'no-repeat');
$(element).css('background-position', '94% center');
$(element).css('cursor', 'progress');
$(element).prev().click();
submit_form_loading = $(element);
}
function submit_form_loading_done() {
if (submit_form_loading) {
$(submit_form_loading).css('background-image', '');
$(submit_form_loading).css('background-repeat', '');
$(submit_form_loading).css('background-position', '');
$(submit_form_loading).css('cursor', '');
submit_form_loading = null;
}
}
function add_new_file_fields() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment