From bff9b027507e0f390e4e3c51ee85147e86d13b2a Mon Sep 17 00:00:00 2001 From: whatevercode Date: Sun, 20 May 2012 21:30:45 +0200 Subject: [PATCH] added reply.status == 'more-exist' handling to get more then 100 results --- option8_vertx/public/js/custom_sync.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/option8_vertx/public/js/custom_sync.js b/option8_vertx/public/js/custom_sync.js index 17035ab..c83ac81 100644 --- a/option8_vertx/public/js/custom_sync.js +++ b/option8_vertx/public/js/custom_sync.js @@ -33,7 +33,7 @@ var params = query(methodMap[method], model); - var replyHandler = function(reply){ + var replyHandler = function(reply, replier){ var data; if(params.action === 'save'){ data = {_id: reply._id || model.id}; @@ -42,9 +42,12 @@ if(params.action === 'find'){ data = model.id ? reply.results[0] : reply.results; } - if(reply.status === 'ok'){ + if(reply.status === 'ok' || reply.status == 'more-exist'){ options.success(data || model, reply.status, options); model.eventBus.send('todos.broadcast.event', {model: model, method: method}); + if(reply.status == 'more-exist'){ + replier(new Object,replyHandler); + } }else{ options.error(model, options); }