From c6ae526eab761a279bb21e47c17eb26552b3d495 Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Tue, 28 Apr 2015 11:27:41 +0200 Subject: [PATCH] Avoid loosing angular context. --- static/js/directives/audiovideo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/directives/audiovideo.js b/static/js/directives/audiovideo.js index f6835e1d..933ce8d5 100644 --- a/static/js/directives/audiovideo.js +++ b/static/js/directives/audiovideo.js @@ -22,7 +22,7 @@ "use strict"; define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/audiovideopeer.html', 'bigscreen', 'webrtc.adapter'], function($, _, template, templatePeer, BigScreen) { - return ["$window", "$compile", "$filter", "mediaStream", "safeApply", "desktopNotify", "buddyData", "videoWaiter", "videoLayout", "animationFrame", function($window, $compile, $filter, mediaStream, safeApply, desktopNotify, buddyData, videoWaiter, videoLayout, animationFrame) { + return ["$window", "$compile", "$filter", "mediaStream", "safeApply", "desktopNotify", "buddyData", "videoWaiter", "videoLayout", "animationFrame", "$timeout", function($window, $compile, $filter, mediaStream, safeApply, desktopNotify, buddyData, videoWaiter, videoLayout, animationFrame, $timeout) { var peerTemplate = $compile(templatePeer); @@ -152,7 +152,7 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ if (DummyStream.is(stream)) { scope.withvideo = false; scope.onlyaudio = true; - _.defer(function() { + $timeout(function() { scope.$emit("active", currentcall); $scope.redraw(); });