make votes work
[shapado:cantonics-shapado.git] / public / javascripts / shapado_ui / answer_ui.js
1 var AnswerUI = {
2   create_on_index: function(data) {
3   },
4   create_on_show: function(data) {
5     $(".answers-list").prepend(data.html);
6     $("article.answer."+data.object_id).effect("highlight", {}, 3000);
7   },
8   update_on_index: function(data) {
9
10   },
11   update_on_show: function(data) {
12     $("article.answer."+data.object_id).html(data.html);
13     $("article.answer."+data.object_id).effect("highlight", {}, 3000);
14   },
15   vote: function(data) {
16     $("article.answer."+data.object_id+" li.votes_average").text(data.average);
17   }
18 }