loleaflet/src/layer/AnnotationManager.js |    2 +-
 loleaflet/src/layer/marker/Annotation.js |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 636c3d2f8f86c392fd0fafea99f3ef478d77d6ba
Author: Pranav Kant <pran...@collabora.co.uk>
Date:   Mon Apr 24 15:44:53 2017 +0530

    loleaflet: Check parent relationship before linking next comment
    
    Change-Id: Ib22e1e1adca0544a70fa224abc9c98060ad83e5f
    (cherry picked from commit 3175a3a0429fd8a31140913c71df176658b7ac97)
    Reviewed-on: https://gerrit.libreoffice.org/36884
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>
    Tested-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index 88cc2c6a..e3174100 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -458,7 +458,7 @@ L.AnnotationManager = L.Class.extend({
                        newId = this._items[parentIdx]._data.id;
                }
                var currentIdx = this.getIndexOf(comment._data.id);
-               if (this._items[currentIdx + 1]) {
+               if (this._items[currentIdx + 1] && 
this._items[currentIdx].parentOf(this._items[currentIdx + 1])) {
                        this._items[currentIdx + 1]._data.parent = newId;
                }
        },
diff --git a/loleaflet/src/layer/marker/Annotation.js 
b/loleaflet/src/layer/marker/Annotation.js
index abed0b01..8a4c7001 100644
--- a/loleaflet/src/layer/marker/Annotation.js
+++ b/loleaflet/src/layer/marker/Annotation.js
@@ -113,6 +113,10 @@ L.Annotation = L.Layer.extend({
                this._nodeReplyText.focus();
        },
 
+       parentOf: function(comment) {
+               return this._data.id === comment._data.parent;
+       },
+
        _createButton: function(container, value, handler) {
                var button = L.DomUtil.create('input', 'loleaflet-controls', 
container);
                button.type = 'button';
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to