From 4ce1b299b390e3d54f9c967d91d371a159bc59a4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 3 Sep 2014 08:12:29 +0000 Subject: [PATCH] docu update and fix IDE warnings --- phpgwapi/js/jsapi/egw_data.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_data.js b/phpgwapi/js/jsapi/egw_data.js index a3eec27e9a..3378725222 100644 --- a/phpgwapi/js/jsapi/egw_data.js +++ b/phpgwapi/js/jsapi/egw_data.js @@ -131,7 +131,7 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { if(a.lastModification < b.lastModification) return 1; if(a.lastModification > b.lastModification) return -1; return 0; - }) + }); window.localStorage.removeItem(indexes.pop().key); return 1; } @@ -203,8 +203,8 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { for(var i = 0; i < cacheCallback[_context.prefix].length; i++) { var cc = cacheCallback[_context.prefix][i]; - var cache_key = false - if(cache_key = cc.callback.call(cc.context, _context)) + var cache_key = cc.callback.call(cc.context, _context); + if(cache_key) { cache_key = CACHE_KEY_PREFIX + _context.prefix + '::' + cache_key; try @@ -212,7 +212,7 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { for (var key in _result.data) { var uid = UID(key, (typeof _context == "object" && _context != null) ? _context.prefix : ""); - + // Register a handler on each data so we can know if it is updated or removed egw.dataUnregisterUID(uid, null, cache_key); egw.dataRegisterUID(uid, function(data, _uid) { @@ -374,8 +374,8 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { for(var i = 0; i < cacheCallback[_context.prefix].length; i++) { var cc = cacheCallback[_context.prefix][i]; - var cache_key = false - if(cache_key = cc.callback.call(cc.context, _context)) + var cache_key = cc.callback.call(cc.context, _context); + if(cache_key) { cache_key = CACHE_KEY_PREFIX + _context.prefix + '::' + cache_key; @@ -441,7 +441,7 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { /** * Turn on long-term client side cache of a particular request * (cache the nextmatch query results) for fast, immediate response - * with old data. + * with old data. * * The request is still sent to the server, and the cache is updated * with fresh data, and any needed callbacks are called again with @@ -771,6 +771,9 @@ egw.extend("data_storage", egw.MODULE_GLOBAL, function (_app, _wnd) { * Deletes the data for a certain uid from the local storage and * unregisters all callback functions associated to it. * + * This does NOT update nextmatch! + * Application code should use: egw(window).refresh(msg, app, id, "delete"); + * * @param _uid is the uid which should be deleted. */ dataDeleteUID: function (_uid) { @@ -817,7 +820,7 @@ egw.extend("data_storage", egw.MODULE_GLOBAL, function (_app, _wnd) { /** * Search for exact UID string or regular expression and return widgets using it * - * @param {string|RegExp) _uid is the uid which should be refreshed. + * @param {string|RegExp} _uid is the uid which should be refreshed. * @return {object} UID: array of (nextmatch-)wigetIds */ dataSearchUIDs: function(_uid)