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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Apr 15 03:04:00 UTC 2019


 loleaflet/src/control/Control.PartsPreview.js |    8 ++++++++
 loleaflet/src/control/Parts.js                |    1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 4e30d3d2a3dacfad34168e17a194e7bf78e725a2
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Wed Nov 28 22:07:33 2018 -0500
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Mon Apr 15 05:03:41 2019 +0200

    leaflet: select the current slide and update previews after reordering
    
    Change-Id: Iec1c41b257744e99d8447518be0b38eb9a28d715
    Reviewed-on: https://gerrit.libreoffice.org/69639
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index 908d7e5ca..92bbd2673 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -211,6 +211,7 @@ L.Control.PartsPreview = L.Control.extend({
 				console.log('shift');
 			} else {
 				this._map.setPart(partId);
+				this._map.selectPart(partId, 1, false); // And select.
 			}
 		}
 	},
@@ -392,6 +393,13 @@ L.Control.PartsPreview = L.Control.extend({
 			if (partId < 0)
 				partId = -1; // First item is -1.
 			this.partsPreview._map._socket.sendMessage('moveselectedclientparts position=' + partId);
+			// Update previews, after a second, since we only get the dragged one invalidated.
+			var that = this.partsPreview;
+			setTimeout(function () {
+				for (var i = 0; i < that._previewTiles.length; ++i) {
+					that._map.getPreview(i, i, 180, 180, {autoUpdate: that.options.autoUpdate, broadcast: true});
+				}
+			}, 1000);
 		}
 
 		this.classList.remove('preview-img-dropsite');
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 95e5bc2a0..c428408e7 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -63,7 +63,6 @@ L.Map.include({
 	// part is the part index/id
 	// how is 0 to deselect, 1 to select, and 2 to toggle selection
 	selectPart: function (part, how, external) {
-		//TODO: Update/track selected parts(?).
 		var docLayer = this._docLayer;
 		var index = docLayer._selectedParts.indexOf(part);
 		if (index >= 0 && how != 1) {


More information about the Libreoffice-commits mailing list