From 846544de29eee3154de2a12fd89f01c6409691c1 Mon Sep 17 00:00:00 2001 From: Simon Eisenmann Date: Tue, 28 Apr 2015 12:07:15 +0200 Subject: [PATCH] Delay DOM append to avoid flash of unrendered text. --- static/js/directives/audiovideo.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/directives/audiovideo.js b/static/js/directives/audiovideo.js index 85b0f619..519e9c1f 100644 --- a/static/js/directives/audiovideo.js +++ b/static/js/directives/audiovideo.js @@ -137,7 +137,6 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ // Render template. peerTemplate(subscope, function(clonedElement, scope) { - $($scope.remoteVideos).append(clonedElement); clonedElement.data("peerid", scope.peerid); scope.element = clonedElement; scope.attachStream = function(stream) { @@ -192,6 +191,9 @@ define(['jquery', 'underscore', 'text!partials/audiovideo.html', 'text!partials/ }); }; scope.attachStream(stream); + $timeout(function() { + $($scope.remoteVideos).append(clonedElement); + }); }); };