Subversion Repository Public Repository

Nextrek

Diff Revisions 588 vs 589 for /Android/SmartCharging/endPoints/nightly/control_panel/js/locals.js

Diff revisions: vs.
  @@ -16,13 +16,28 @@
16 16 processData: false,
17 17 type: 'POST',
18 18 success: function(data) {
19 - if (data.return == 0) {
19 + if (data.comments) {
20 20 alert(JSON.stringify());
21 - /*if (data.comments && data.comments.length > 0) {
21 + if (data.comments.length > 0) {
22 +
23 + for (var i = 0; data.comments.length; i++) {
24 + //per ora test
25 + $("#comment-list").append(data.comments[i]);
26 + }
27 +
28 + params = JSON.parse(this.params);
29 +
30 + if (data.count < params.startIndex+10) {
31 + $("#more-comments-button").hide();
32 + } else {
33 + $("#more-comments-button").click(function() {
34 + fetchComments(local_id, startIndex+10);
35 + });
36 + }
22 37
23 38 } else {
24 -
25 - }*/
39 + $("#comment-list").html("Non ci sono commenti al locale.");
40 + }
26 41 } else {
27 42 alert("Errore nel caricare i commenti");
28 43 }