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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 21 19:23:03 UTC 2019


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

New commits:
commit 2603d70039a17ee9ec627d776e2d7990e2ff82da
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Jan 21 20:18:50 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jan 21 20:22:46 2019 +0100

    Show correct avatar during comment insertion
    
    Change-Id: I86b373da8cf6f044fe745b00bc917787583780b9
    Reviewed-on: https://gerrit.libreoffice.org/66698
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/layer/AnnotationManager.js b/loleaflet/src/layer/AnnotationManager.js
index cc9615d32..339f3d269 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -827,12 +827,18 @@ L.AnnotationManager = L.Class.extend({
 
 L.Map.include({
 	insertComment: function() {
+		var avatar = undefined;
+		var author = this.getViewName(this._docLayer._viewId);
+		if (author in this._viewInfoByUserName) {
+			avatar = this._viewInfoByUserName[author].userextrainfo.avatar;
+		}
 		this._docLayer.newAnnotation({
 			text: '',
 			textrange: '',
-			author: this.getViewName(this._docLayer._viewId),
+			author: author,
 			dateTime: new Date().toDateString(),
-			id: 'new' // 'new' only when added by us
+			id: 'new', // 'new' only when added by us
+			avatar: avatar
 		});
 	}
 });


More information about the Libreoffice-commits mailing list