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

Pranav Kant pranavk at collabora.co.uk
Wed Feb 22 10:18:59 UTC 2017


 loleaflet/src/layer/AnnotationManager.js |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit f4d9d587b0a7ac2c8c38c5e4d706e3ef6d1b9f15
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 22 15:47:53 2017 +0530

    loleaflet: Listen to remove callbacks and remove comment when asked to
    
    Change-Id: I4101cfa1e848f63e6ed14c131a35a14146427721

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 54e371a..a76e9f0 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -205,7 +205,7 @@ L.AnnotationManager = L.Class.extend({
 
 		} else if (obj.comment.action === 'Remove') {
 			if (this.getItem(obj.comment.id)) {
-				// something wrong here
+				this.remove(obj.comment.id);
 			}
 		} else if (obj.comment.action === 'Modify') {
 			obj.comment.anchorPos = L.LOUtil.stringToPoint(obj.comment.anchorPos);
commit 5078d31aa08cd695c318b4c9d162ebc2dbe8d1e0
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 22 15:43:13 2017 +0530

    loleaflet: Do not check for anchorPos on remove callbacks
    
    Otherwise our js errors out.
    
    Change-Id: If70468ee12f70990f7d4e5c7cd8e01262437e769

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index 3d3a12e..54e371a 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -188,9 +188,9 @@ L.AnnotationManager = L.Class.extend({
 
 	onACKComment: function (textMsg) {
 		var obj = JSON.parse(textMsg.substring('comment:'.length + 1));
-		obj.comment.anchorPos = L.LOUtil.stringToPoint(obj.comment.anchorPos);
 
 		if (obj.comment.action === 'Add') {
+			obj.comment.anchorPos = L.LOUtil.stringToPoint(obj.comment.anchorPos);
 			var added = this.getItem('new');
 			if (added) {
 				delete obj.comment.action;
@@ -208,6 +208,7 @@ L.AnnotationManager = L.Class.extend({
 				// something wrong here
 			}
 		} else if (obj.comment.action === 'Modify') {
+			obj.comment.anchorPos = L.LOUtil.stringToPoint(obj.comment.anchorPos);
 			var modified = this.getItem(obj.comment.id);
 			if (modified) {
 				modified._data = obj.comment;
commit f93c3e566021b9a61d0a07c61152f438f7486c25
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 22 15:41:17 2017 +0530

    loleaflet: Other things can change too
    
    Modify callback is emitted even when the content changes, it doesn't
    just signify a change in anchor position
    
    Change-Id: I287efc6cd5f170a68ed73b303c50d55e6bfd45e8

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index fb01ddf..3d3a12e 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -209,8 +209,9 @@ L.AnnotationManager = L.Class.extend({
 			}
 		} else if (obj.comment.action === 'Modify') {
 			var modified = this.getItem(obj.comment.id);
-			if (modified && !modified._data.anchorPos.equals(obj.comment.anchorPos)) {
-				modified._data.anchorPos = obj.comment.anchorPos;
+			if (modified) {
+				modified._data = obj.comment;
+				modified._updateContent();
 				this.update();
 			}
 		}
commit 5a3ac377986a3776d45a4973e48f4454f2522eca
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Wed Feb 22 15:40:50 2017 +0530

    loleaflet comments: Id is string type, not integer
    
    Change-Id: I03f8881e70c0043cd14e5b2d7cf3ce5dd27870b4

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index e5dfbdd..fb01ddf 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -236,7 +236,7 @@ L.AnnotationManager = L.Class.extend({
 	_onAnnotationRemove: function (id) {
 		var comment = {
 			Id: {
-				type: 'long',
+				type: 'string',
 				value: id
 			}
 		};
@@ -261,7 +261,7 @@ L.AnnotationManager = L.Class.extend({
 		} else {
 			var comment = {
 				Id: {
-					type: 'long',
+					type: 'string',
 					value: e.annotation._data.id
 				},
 				Text: {


More information about the Libreoffice-commits mailing list