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]); };