[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-4' - loleaflet/dist loleaflet/src

Mihai Varga mihai.varga at collabora.com
Thu Aug 20 06:26:13 PDT 2015


 loleaflet/dist/leaflet.css |    8 ++++++++
 loleaflet/src/map/Map.js   |    7 ++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit f1cf8a1da92564c555b15696b7fb908194676717
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Thu Aug 20 15:56:06 2015 +0300

    loleaflet: use an iframe to detect window size changes
    
    If running in a popup

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index c7c43b7..0d063b3 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -673,6 +673,14 @@ a.leaflet-control-buttons:hover:first-child {
 	padding: 0px;
 }
 
+.resize-detector {
+    position: absolute;
+    width: 100%;
+    height: 100%;
+    z-index: 0;
+    visibility: hidden;
+}
+
 .parts-preview {
 	background: #DFDFDF;
 	position: absolute;
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 5799ca7..b935fdc 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -471,6 +471,7 @@ L.Map = L.Evented.extend({
 
 		var textAreaContainer = L.DomUtil.create('div', 'clipboard-container', container.parentElement);
 		this._textArea = L.DomUtil.create('textarea', 'clipboard', textAreaContainer);
+		this._resizeDetector = L.DomUtil.create('iframe', 'resize-detector', container);
 
 		container._leaflet = true;
 	},
@@ -592,7 +593,11 @@ L.Map = L.Evented.extend({
 		L.DomEvent[onOff](this._textArea, 'copy keydown keypress keyup', this._handleDOMEvent, this);
 
 		if (this.options.trackResize) {
-			L.DomEvent[onOff](window, 'resize', this._onResize, this);
+			var target = window;
+			if (window.opener) {
+				target = this._resizeDetector.contentWindow;
+			}
+			L.DomEvent[onOff](target, 'resize', this._onResize, this);
 		}
 	},
 


More information about the Libreoffice-commits mailing list