From d2b7b640d9e4b1d6aadeabe5a6e09dd2a85813ad Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 20 Feb 2013 14:16:00 -0300 Subject: [PATCH] Fix print issue loading cached maps. --- mindplot/src/main/javascript/LocalStorageManager.js | 5 +++-- wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp | 2 +- wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp | 2 +- wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js index c7cb45f6..7f981452 100644 --- a/mindplot/src/main/javascript/LocalStorageManager.js +++ b/mindplot/src/main/javascript/LocalStorageManager.js @@ -18,9 +18,10 @@ mindplot.LocalStorageManager = new Class({ Extends:mindplot.PersistenceManager, - initialize:function (documentUrl) { + initialize:function (documentUrl,forceLoad) { this.parent(); this.documentUrl = documentUrl; + this.forceLoad = forceLoad; }, saveMapXml:function (mapId, mapXml, pref, saveHistory, events) { @@ -33,7 +34,7 @@ mindplot.LocalStorageManager = new Class({ loadMapDom:function (mapId) { var xml = localStorage.getItem(mapId + "-xml"); - if (xml == null) { + if (xml == null || forceLoad) { var xmlRequest = new Request({ url:this.documentUrl.replace("{id}", mapId), headers:{"Content-Type":"text/plain","Accept":"application/xml"}, diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 844a77a6..0af64869 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -45,7 +45,7 @@ ); - options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}${hid!=null?'/':''}${hid!=null?hid:''}/document/xml${principal!=null?'':'-pub'}"); + options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}${hid!=null?'/':''}${hid!=null?hid:''}/document/xml${principal!=null?'':'-pub'}",true); var userOptions = ${mindmap.properties}; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp index ac311dd6..278a4b41 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp @@ -45,7 +45,7 @@ options.readOnly = true; // Configure persistence ... - options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml${principal!=null?'':'-pub'}"); + options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml${principal!=null?'':'-pub'}",true); // Build designer ... var designer = buildDesigner(options); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index b8a31272..cc6c5919 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -77,7 +77,7 @@ options.readOnly = true; // Configure loader ... - options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml${principal!=null?'':'-pub'}"); + options.persistenceManager = new mindplot.LocalStorageManager("c/restful/maps/{id}/document/xml${principal!=null?'':'-pub'}",true); // Build designer ... var designer = buildDesigner(options);