Module: nagvis Branch: master Commit: 86b8e182ca01651b6a2467a4bd113b7c9b8edd3e URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=86b8e182ca01651b6a2467a4bd113b7c9b8edd3e
Author: Lars Michelsen <[email protected]> Date: Sun Dec 19 12:04:13 2010 +0100 Not reparsing map after changed map config file when editing at least one object --- share/frontend/nagvis-js/js/frontend.js | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/share/frontend/nagvis-js/js/frontend.js b/share/frontend/nagvis-js/js/frontend.js index 842848a..2728a7a 100644 --- a/share/frontend/nagvis-js/js/frontend.js +++ b/share/frontend/nagvis-js/js/frontend.js @@ -34,7 +34,13 @@ var oHoverTemplatesChild = {}; var oHoverUrls = {}; var oContextTemplates = {}; var oAutomapParams = {}; +// This is turned to true when the map is currently reparsing (e.g. due to +// a changed map config file). This blocks object updates. var bBlockUpdates = false; +// This is turned to true when at least one object on the map is unlocked +// for editing. When set to true this flag prevents map reloading by changed +// map config files +var iNumUnlocked = false; var cacheHeaderHeight = null; /** @@ -796,6 +802,12 @@ function getMapObjByDomObjId(id) { function toggleMapObjectLock(objectId) { var oObj = getMapObjByDomObjId(objectId); oObj.bIsLocked = !oObj.bIsLocked; + + if(oObj.bIsLocked) + iNumUnlocked += 1; + else + iNumUnlocked -= 1; + oObj.toggleObjControls(); oObj = null; } @@ -1987,9 +1999,13 @@ function workerUpdate(iCount, sType, sIdentifier) { // Check for changed map configuration if(oCurrentFileAges && checkMapCfgChanged(oCurrentFileAges[oPageProperties.map_name], oPageProperties.map_name)) { - eventlog("worker", "info", "Map configuration file was updated. Reparsing the map."); - if(parseMap(oCurrentFileAges[oPageProperties.map_name], oPageProperties.map_name) === false) - eventlog("worker", "error", "Problem while reparsing the map after new map configuration"); + if(iNumUnlocked > 0) { + eventlog("worker", "info", "Map config updated. "+iNumUnlocked+" objects unlocked - not reloading."); + } else { + eventlog("worker", "info", "Map configuration file was updated. Reparsing the map."); + if(parseMap(oCurrentFileAges[oPageProperties.map_name], oPageProperties.map_name) === false) + eventlog("worker", "error", "Problem while reparsing the map after new map configuration"); + } } // I don't think empty maps make any sense. So when no objects are present: ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
