From 912dc1af8f2bb7b940643a82253cf949a683ef84 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Thu, 29 Dec 2016 11:37:56 +0100 Subject: [PATCH] Bind mediafile to projector scope (fixes #2706) --- openslides/mediafiles/static/js/mediafiles/projector.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openslides/mediafiles/static/js/mediafiles/projector.js b/openslides/mediafiles/static/js/mediafiles/projector.js index 5beaefabf..fb9319bf1 100644 --- a/openslides/mediafiles/static/js/mediafiles/projector.js +++ b/openslides/mediafiles/static/js/mediafiles/projector.js @@ -21,15 +21,14 @@ angular.module('OpenSlidesApp.mediafiles.projector', [ 'Mediafile', function ($scope, Mediafile) { // load mediafile object - var mediafile = Mediafile.get($scope.element.id); - $scope.mediafile = mediafile; + Mediafile.bindOne($scope.element.id, $scope, 'mediafile'); // Allow the elements to render properly setTimeout(function() { if ($scope.mediafile) { if ($scope.mediafile.is_pdf) { - $scope.pdfName = mediafile.title; - $scope.pdfUrl = mediafile.mediafileUrl; + $scope.pdfName = $scope.mediafile.title; + $scope.pdfUrl = $scope.mediafile.mediafileUrl; } else if ($scope.mediafile.is_video) { var player = angular.element.find('#video-player')[0]; if ($scope.element.playing) {