From 0a4399951a8bed868a735505d781829cc3fec919 Mon Sep 17 00:00:00 2001
From: mntmn <lukas@mntmn.com>
Date: Mon, 11 May 2020 18:26:16 +0200
Subject: [PATCH] when space is embedded (?embedded=1), toggle fullscreen via
 present button

---
 public/javascripts/spacedeck_spaces.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/public/javascripts/spacedeck_spaces.js b/public/javascripts/spacedeck_spaces.js
index 5b5126b..aee3217 100644
--- a/public/javascripts/spacedeck_spaces.js
+++ b/public/javascripts/spacedeck_spaces.js
@@ -100,13 +100,13 @@ var SpacedeckSpaces = {
     },
     
     load_space: function(space_id, on_success, on_error) {
-
-      console.log("load space: ", space_id);
       this.folder_spaces_filter="";
       this.folder_spaces_search="";
 
       space_auth = get_query_param("spaceAuth");
 
+      this.embedded = !!(get_query_param("embedded"));
+
       var userReady = function() {
         this.close_dropdown();
 
@@ -649,6 +649,13 @@ var SpacedeckSpaces = {
       this.present_mode = !this.present_mode;
       if (this.present_mode) {
         //this.go_to_first_zone();
+        if (this.embedded) {
+          document.documentElement.requestFullscreen();
+        }
+      } else {
+        if (this.embedded) {
+          document.exitFullscreen();
+        }
       }
     },
 
-- 
GitLab