[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-0' - loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Sat Mar 18 22:52:22 UTC 2017


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

New commits:
commit 8ced3ca9acb2c222b1d8e6c4dec4bc3ecc699013
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
    (cherry picked from commit ffd00d8824fbae2012f5af4bf59879fda460ba64)
    Reviewed-on: https://gerrit.libreoffice.org/35040
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.WOPI.js b/loleaflet/src/map/handler/Map.WOPI.js
index 38e0a5bc..110c0adb 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