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.nakash...@collabora.co.uk>
AuthorDate: Wed Nov 28 22:07:33 2018 -0500
Commit:     Ashod Nakashian <ashnak...@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 <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@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) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to