Commits

Anonymous committed e154e70

provide a 'Nocache' option for JiakClient.walk - if true, a cache-breaking unique-id query param will be appended to the walk request
also, use this nocache feature in stickynotes to make sure group->notes walk is always fresh

  • Participants
  • Parent commits 23bacaf

Comments (0)

Files changed (3)

File client_lib/jiak.js

     });
 }
 
-JiakClient.prototype.walk = function(Start, Spec, Callback) {
+JiakClient.prototype.walk = function(Start, Spec, Callback, Nocache) {
     var req = {
         dataType: "json",
         success: Callback
             ((Spec[i].acc || i == Spec.length-1) ? '1' : '_')+'/';
     }
 
+    if (Nocache) req.url += '?nocache='+(+new Date());
+
     return $.ajax(req);
 }
 

File demo/stickynotes/priv/www/js/application.js

                 [{bucket:'notes'}],
                 function(res) {
                     renderNotes(res.results[0]);
-                });
+                },
+                true);
     $('div.group').removeClass('active').removeClass('active');
     $('div#group_'+groupid).addClass('active');
 }

File demo/stickynotes/priv/www/js/jiak.js

     });
 }
 
-JiakClient.prototype.walk = function(Start, Spec, Callback) {
+JiakClient.prototype.walk = function(Start, Spec, Callback, Nocache) {
     var req = {
         dataType: "json",
         success: Callback
             ((Spec[i].acc || i == Spec.length-1) ? '1' : '_')+'/';
     }
 
+    if (Nocache) req.url += '?nocache='+(+new Date());
+
     return $.ajax(req);
 }