From 1d589dfeb8cad6671862a6acaeb427e0f7a404c1 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Sat, 24 Oct 2015 17:29:04 +0200 Subject: [PATCH] Fix "discrete" parameter passing. Fix small Open Layer map not showing when panel is hidden. --- .../res/js/es6/model/RemoteNodeProvider.es6 | 3 +-- .../plugins/meta.exif/class.ExifCellRenderer.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 b/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 index 607476702f..fefbe69863 100644 --- a/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 +++ b/core/src/plugins/gui.ajax/res/js/es6/model/RemoteNodeProvider.es6 @@ -62,7 +62,6 @@ class RemoteNodeProvider{ params['recursive'] = true; params['depth'] = depth; } - //if(this.discrete) conn.discrete = true; var path = node.getPath(); // Double encode # character var paginationHash; @@ -85,7 +84,7 @@ class RemoteNodeProvider{ var complete = function (transport){ this.parseNodes(node, transport, nodeCallback, childCallback); }.bind(this); - PydioApi.getClient().request(params, complete); + PydioApi.getClient().request(params, complete, null, {discrete:this.discrete}); } /** diff --git a/core/src/plugins/meta.exif/class.ExifCellRenderer.js b/core/src/plugins/meta.exif/class.ExifCellRenderer.js index 2c18f79fb5..11d3bf2232 100644 --- a/core/src/plugins/meta.exif/class.ExifCellRenderer.js +++ b/core/src/plugins/meta.exif/class.ExifCellRenderer.js @@ -84,6 +84,23 @@ Class.create("ExifCellRenderer", { metadata.set('ol_center', {latitude:parseFloat(latiCell.getAttribute('latiDegree')),longitude:parseFloat(longiCell.getAttribute("longiDegree"))}); var id = "small_map_" + Math.random(); latiCell.up('div.infoPanelTable').insert({top:'
'}); + var testDim = $(id).getDimensions(); + if(testDim.width == 0 && testDim.height == 0){ + // seems like it's not visible. We are probably inside a tab, try to listen to tab switches + var tab = latiCell.up('div[ajxpClass="AjxpTabulator"]'); + if(tab && tab.ajxpPaneObject){ + var object = tab.ajxpPaneObject; + object.observeOnce("switch", function(tabId){ + if($(id).getDimensions().width != 0){ + pydio.Registry.loadEditorResources(editorData.resourcesManager); + OLViewer.prototype.createOLMap(ajxpNode, id, false, false); + } + }); + }else{ + // Silently fail, otherwise it will trigger an OpenLayer Error + } + return; + } pydio.Registry.loadEditorResources(editorData.resourcesManager); OLViewer.prototype.createOLMap(ajxpNode, id, false, false); }