From ab35fa8f508c9f92674ed9ce5b9d0a896b0e9fbf Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Fri, 11 Jul 2014 17:44:22 +0200 Subject: [PATCH] Make sure to disable presentation when screensharing and vice verca. --- static/js/directives/presentation.js | 9 ++++++++- static/js/directives/screenshare.js | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index e98413dd..2c401f54 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -245,7 +245,6 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, // Updater function to bring in new calls. var updater = function(event, state, currentcall) { - console.log("XXX updater", event, state, currentcall); switch (state) { case "completed": case "connected": @@ -429,6 +428,14 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $($window).on("resize", function() { $scope.$emit("redrawPdf"); }); + + $scope.$watch("layout.main", function(newval, oldval) { + console.log("presentation main", newval); + if (newval && newval !== "presentation") { + $scope.hidePresentation(); + } + }); + }]; return { diff --git a/static/js/directives/screenshare.js b/static/js/directives/screenshare.js index 160c2e88..587b5b19 100644 --- a/static/js/directives/screenshare.js +++ b/static/js/directives/screenshare.js @@ -290,6 +290,13 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials } }); + $scope.$watch("layout.main", function(newval, oldval) { + console.log("screenshare main", newval); + if (newval && newval !== "screenshare") { + $scope.stopScreenshare(); + } + }); + }]; var compile = function(tElement, tAttr) {