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

Henry Castro hcastro at collabora.com
Sun Mar 26 15:13:48 UTC 2017


 loleaflet/src/layer/tile/ImpressTileLayer.js |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

New commits:
commit 5e67e19a6c0d0e4d7ba32bfed5df4cf553cfe9e7
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun Mar 26 11:15:18 2017 -0400

    loleaflet: handle annotation reply for Impress documents
    
    Change-Id: I47edbc8807f5f7aa5a28b3a4fd79aeebc8026262

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index 1390216e..09015cbf 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -14,6 +14,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
 	beforeAdd: function (map) {
 		map.on('updateparts', this.onUpdateParts, this);
 		map.on('AnnotationCancel', this.onAnnotationCancel, this);
+		map.on('AnnotationReply', this.onReplyClick, this);
 		map.on('AnnotationSave', this.onAnnotationSave, this);
 		map.on('AnnotationScrollUp', this.onAnnotationScrollUp, this);
 		map.on('AnnotationScrollDown', this.onAnnotationScrollDown, this);
@@ -52,6 +53,12 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		draft.focus();
 	},
 
+	onAnnotationReply: function (annotation) {
+		var draft = L.annotation(this._map.getCenter(), annotation._data).addTo(this._map);
+		draft.reply();
+		draft.focus();
+	},
+
 	onAnnotationRemove: function (id) {
 		var comment = {
 			Id: {
@@ -90,6 +97,22 @@ L.ImpressTileLayer = L.TileLayer.extend({
 		this._map.focus();
 	},
 
+	onReplyClick: function (e) {
+		var comment = {
+			Id: {
+				type: 'string',
+				value: e.annotation._data.id
+			},
+			Text: {
+				type: 'string',
+				value: e.annotation._data.reply
+			}
+		};
+		this._map.sendUnoCommand('.uno:ReplyToAnnotation', comment);
+		this._map.removeLayer(e.annotation);
+		this._map.focus();
+	},
+
 	onAnnotationScrollDown: function (e) {
 		this._topAnnotation = Math.min(++this._topAnnotation, this._annotations[this._partHashes[this._selectedPart]].length - 1);
 		this.layoutAnnotations();


More information about the Libreoffice-commits mailing list