From 898f68829d90b502f05ceb4969a17d66b1d53b94 Mon Sep 17 00:00:00 2001 From: Osborne Brook Partnership Date: Wed, 10 Sep 2014 14:32:15 +0100 Subject: [PATCH] Only append bar to the first body element In the case where one is using an svg diagram with a foreign object element which contains it's own self-contained html DOM, the progress bar was being applied to all of them. Resulting in many loading bars. This patch restricts the selector to only find one element, which will the first. --- src/loading-bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loading-bar.js b/src/loading-bar.js index b5a823c..720de0c 100644 --- a/src/loading-bar.js +++ b/src/loading-bar.js @@ -181,7 +181,7 @@ angular.module('cfp.loadingBar', []) $animate = $injector.get('$animate'); } - var $parent = $document.find($parentSelector); + var $parent = $document.find($parentSelector).eq(0); $timeout.cancel(completeTimeout); // do not continually broadcast the started event: