diff --git a/src/mytinytodo.js b/src/mytinytodo.js index 2f48069..738a1e4 100644 --- a/src/mytinytodo.js +++ b/src/mytinytodo.js @@ -577,7 +577,6 @@ function loadTasks(opts) }); refreshTaskCnt(); $('#tasklist').html(tasks); -//port: if(json.denied) errorDenied(); }); }; diff --git a/src/mytinytodo_ajax_storage.js b/src/mytinytodo_ajax_storage.js index c0b0ed1..5aa9ef6 100644 --- a/src/mytinytodo_ajax_storage.js +++ b/src/mytinytodo_ajax_storage.js @@ -24,7 +24,10 @@ mytinytodoStorageAjax.prototype = { if(!this[action]) throw "Unknown storage action: "+action; - this[action](params, callback); + this[action](params, function(json){ + if(json.denied) mtt.errorDenied(); + callback.call(mtt, json) + }); }, @@ -142,10 +145,7 @@ mytinytodoStorageAjax.prototype = publishList: function(params, callback) { - $.post(this.mtt.mttUrl+'ajax.php?publishList', { list:params.list, publish:params.publish }, function(json){ - if(json.denied) mtt.errorDenied(); - callback.call(mtt, json) - }, 'json'); + $.post(this.mtt.mttUrl+'ajax.php?publishList', { list:params.list, publish:params.publish }, callback, 'json'); }, changeListOrder: function(params, callback)