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

Ashod Nakashian ashod.nakashian at collabora.co.uk
Sun Oct 30 16:51:28 UTC 2016


 loleaflet/src/map/Map.js |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit fb8d89589b971218cedb2cdd708fffe6440ab867
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Sun Oct 30 12:44:04 2016 -0400

    loleaflet: fire addview and removeview events last
    
    This fixes regression to the hackish fix done
    in b26f2f2738c4c60c8b3212f222336d07465744da -
    loleaflet: prevent the zoomlevel from changing on connect/disconnect
    
    Change-Id: I09c899546d0d8bfbe4c274b0774fd30008cbcfa5
    Reviewed-on: https://gerrit.libreoffice.org/30400
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 2d6ceb6..0181cc6 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -136,15 +136,19 @@ L.Map = L.Evented.extend({
 
 	addView: function(viewid, userid, username, color) {
 		this._viewInfo[viewid] = {'userid': userid, 'username': username, 'color': color};
-		this.fire('addview', {viewId: viewid, username: username});
 		this.WOPIPostMessage('View_Added', {ViewId: viewid, UserId: userid, UserName: username, Color: color});
+
+		// Fire last, otherwise not all events are handled correctly.
+		this.fire('addview', {viewId: viewid, username: username});
 	},
 
 	removeView: function(viewid) {
 		var username = this._viewInfo[viewid].username;
 		delete this._viewInfo[viewid];
-		this.fire('removeview', {viewId: viewid, username: username});
 		this.WOPIPostMessage('View_Removed', {ViewId: viewid});
+
+		// Fire last, otherwise not all events are handled correctly.
+		this.fire('removeview', {viewId: viewid, username: username});
 	},
 
 	getViewName: function(viewid) {


More information about the Libreoffice-commits mailing list