From 2274d6ff84c0a5b12361d796a199988d64aee2ae Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Thu, 12 May 2016 16:54:05 -0400 Subject: [PATCH] Fix error --- static/js/directives/ui/credentials-dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/directives/ui/credentials-dialog.js b/static/js/directives/ui/credentials-dialog.js index 3f83606b1..646197bac 100644 --- a/static/js/directives/ui/credentials-dialog.js +++ b/static/js/directives/ui/credentials-dialog.js @@ -23,7 +23,9 @@ angular.module('quay').directive('credentialsDialog', function () { $scope.docker = {}; $scope.$on('$destroy', function() { - document.body.removeChild($element[0]); + if ($scope.inBody) { + document.body.removeChild($element[0]); + } }); // Generate a unique ID for the dialog. @@ -43,6 +45,7 @@ angular.module('quay').directive('credentialsDialog', function () { // Move the dialog to the body to prevent it from being affected // by being placed inside other tables. + $scope.inBody = true; document.body.appendChild($element[0]); };