[Libreoffice-commits] online.git: loleaflet/src

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 28 15:07:46 UTC 2020


 loleaflet/src/control/Control.PartsPreview.js |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit ec20b15a8f10cc5c28f9a2c092cba29bdd294c06
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Mon Jun 29 15:03:05 2020 +0530
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Jul 28 17:07:28 2020 +0200

    leaflet: prevent losing selection while dragging multiple slides
    
    Change-Id: Ia7dca36495d802f2c55648cf0a33ae8d71124d64
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97394
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index 73d355a18..b50fd8c66 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -544,8 +544,11 @@ L.Control.PartsPreview = L.Control.extend({
 		var part = $(this.partsPreview._partsPreviewCont).find('.mCSB_container .preview-frame').index(e.target.parentNode);
 		if (part !== null) {
 			var partId = parseInt(part) - 1; // The first part is just a drop-site for reordering.
-			this.partsPreview._map.setPart(partId);
-			this.partsPreview._map.selectPart(partId, 1, false); // And select.
+			if (this.partsPreview._map._docLayer && !this.partsPreview._map._docLayer._selectedParts.includes(partId))
+			{
+				this.partsPreview._map.setPart(partId);
+				this.partsPreview._map.selectPart(partId, 1, false); // And select.
+			}
 		}
 		// By default we move when dragging, but can
 		// support duplication with ctrl in the future.


More information about the Libreoffice-commits mailing list