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

Pranav Kant pranavk at collabora.co.uk
Fri Mar 10 11:08:10 UTC 2017


 loleaflet/src/map/handler/Map.WOPI.js |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit ffd00d8824fbae2012f5af4bf59879fda460ba64
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Mar 10 16:34:58 2017 +0530

    loleaflet: Allow keeping document always active via PostMessage
    
    To instruct the loleaflet iframe to not dim the document, it needs to
    send the message in following format :
    
    {
     MessageId: 'Set_Settings',
     SendTime: 1329014075000,
     Values: {
    	AlwaysActive: true
     }
    }
    
    Similarly, set AlwaysActive to false to active dimming the screen again.
    
    Change-Id: Icb5d615268e4da2c3ed2f22df8c0f3e52f370a70

diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 38e0a5b..110c0ad 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -98,7 +98,13 @@ L.Map.WOPI = L.Handler.extend({
 		}
 
 		var msg = JSON.parse(e.data);
-		if (msg.MessageId === 'Get_Views') {
+		if (msg.MessageId === 'Set_Settings') {
+			if (msg.Values) {
+				var alwaysActive = msg.Values.AlwaysActive;
+				this._map.options.alwaysActive = !!alwaysActive;
+			}
+		}
+		else if (msg.MessageId === 'Get_Views') {
 			var getMembersRespVal = [];
 			for (var viewInfoIdx in this._map._viewInfo) {
 				getMembersRespVal.push({


More information about the Libreoffice-commits mailing list