From e071635449e83cfec384037f35d0185f0161e8bc Mon Sep 17 00:00:00 2001 From: Sergio Oliveira Date: Thu, 26 Sep 2013 15:04:03 -0300 Subject: [PATCH] Locking vote button while waiting for request --- src/super_archives/templates/message-thread.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/super_archives/templates/message-thread.html b/src/super_archives/templates/message-thread.html index a341ec8..1e97ce7 100644 --- a/src/super_archives/templates/message-thread.html +++ b/src/super_archives/templates/message-thread.html @@ -29,6 +29,7 @@ } $btn.toggleClass('btn-success'); $btn.toggleClass('btn-default'); + $btn.button('reset') } function vote_fail_callback(jqXHR, textStatus, errorThrown) { @@ -46,6 +47,7 @@ function get_vote_ajax_dict(msg_id, method) { var csrftoken = $.cookie('csrftoken'); + $('#msg-' + msg_id + ' .vote.btn-success').button('loading'); return { url: "/api/message/" + msg_id + "/vote", @@ -76,9 +78,9 @@ // Binding functions $(function() { + console.debug('binding vote function to btns'); $('.email-message').each(function() { var msg_id = this.getAttribute('id').split('-')[1]; - console.debug('binding vote calls to ' + msg_id); $('.vote.btn-default', this).bind('click', function() { vote(msg_id); @@ -157,9 +159,9 @@ {{ email.votes_count }} {% if user in email.vote_list %} - -- libgit2 0.21.2