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

Pranav Kant pranavk at collabora.co.uk
Mon Mar 20 08:54:11 UTC 2017


 loleaflet/dist/loleaflet.css                  |    4 ++++
 loleaflet/dist/partsPreviewControl.css        |    2 ++
 loleaflet/src/control/Control.PartsPreview.js |    4 ++--
 loleaflet/src/layer/tile/ImpressTileLayer.js  |    3 +++
 4 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit f01eb9482a58e50e2e0af353998894dce03c6c73
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Mon Mar 20 13:58:33 2017 +0530

    loleaflet: Slide sorter for draw documents
    
    (cherry picked from commit 064b2508a7bde1e2d3422824cd06bf0f7c915061)
    
     Conflicts:
            loleaflet/src/layer/tile/ImpressTileLayer.js
    
    Change-Id: I4ad11236c0186561b5c7df1a3c634e54f8576c8c
    Reviewed-on: https://gerrit.libreoffice.org/35454
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index da8a073e..e3f70a16 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -45,6 +45,10 @@ body {
     display: block;
 }
 
+#presentation-controls-wrapper.drawing {
+    bottom: 34px; /* Hide the presentation toolbar (insert slide etc.) for doctype = drawing */
+}
+
 #presentation-controls-wrapper.readonly {
     top: 30px;
 }
diff --git a/loleaflet/dist/partsPreviewControl.css b/loleaflet/dist/partsPreviewControl.css
index 4dc87f95..438b137d 100644
--- a/loleaflet/dist/partsPreviewControl.css
+++ b/loleaflet/dist/partsPreviewControl.css
@@ -19,6 +19,8 @@
 	}
 
 .preview-img {
+	/* In draw docs, the width of previews are small, but we want a min of 180px to align it with document's left edge */
+        min-width: 180px;
 	vertical-align: middle;
 	max-width: 184px;
 	cursor: pointer;
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index c4409105..f466be8c 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -28,7 +28,7 @@ L.Control.PartsPreview = L.Control.extend({
 			return;
 		}
 
-		if (docType === 'presentation') {
+		if (docType === 'presentation' || docType === 'drawing') {
 			if (!this._previewInitialized)
 			{
 				// make room for the preview
@@ -145,7 +145,7 @@ L.Control.PartsPreview = L.Control.extend({
 	},
 
 	_updatePreview: function (e) {
-		if (this._map.getDocType() === 'presentation') {
+		if (this._map.getDocType() === 'presentation' || this._map.getDocType() === 'drawing') {
 			// the scrollbar has to be re-initialized here else it doesn't work
 			// probably a bug from the scrollbar
 			this._previewTiles[e.id].onload = function () {
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index da0166c6..c00a4561 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -126,6 +126,9 @@ L.ImpressTileLayer = L.TileLayer.extend({
 			this._docWidthTwips = command.width;
 			this._docHeightTwips = command.height;
 			this._docType = command.type;
+			if (this._docType === 'drawing') {
+				L.DomUtil.addClass(L.DomUtil.get('presentation-controls-wrapper'), 'drawing');
+			}
 			this._updateMaxBounds(true);
 			this._documentInfo = textMsg;
 			this._parts = command.parts;


More information about the Libreoffice-commits mailing list