From e9dbcdcbca64dae8b2909e3ca5f37fc6743af867 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Thu, 24 Mar 2016 12:49:22 -0700 Subject: [PATCH 1/2] Make the loader an element instead --- src/ui/public/chrome/chrome.html | 3 ++- src/ui/public/chrome/directives/kbn_loading_indicator.js | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ui/public/chrome/chrome.html b/src/ui/public/chrome/chrome.html index 75cbaaf9ee49..a5fb0e84a885 100644 --- a/src/ui/public/chrome/chrome.html +++ b/src/ui/public/chrome/chrome.html @@ -64,7 +64,8 @@ -
+ +
diff --git a/src/ui/public/chrome/directives/kbn_loading_indicator.js b/src/ui/public/chrome/directives/kbn_loading_indicator.js index 63b32dfb788b..1f5967c8b89f 100644 --- a/src/ui/public/chrome/directives/kbn_loading_indicator.js +++ b/src/ui/public/chrome/directives/kbn_loading_indicator.js @@ -7,11 +7,7 @@ UiModules .get('ui/kibana') .directive('kbnLoadingIndicator', function ($compile) { return { - restrict: 'AC', - link: function (scope, $el) { - const $loadingEl = angular.element(spinnerTemplate); - $el.append($loadingEl); - $compile($loadingEl)(scope); - } + restrict: 'E', + template: spinnerTemplate, }; }); From e60aca3b61c36344078ed76036e90be9e72ef419 Mon Sep 17 00:00:00 2001 From: Rashid Khan Date: Thu, 24 Mar 2016 13:00:33 -0700 Subject: [PATCH 2/2] Tests updates --- src/ui/public/chrome/__tests__/kbn_loading_indicator.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ui/public/chrome/__tests__/kbn_loading_indicator.js b/src/ui/public/chrome/__tests__/kbn_loading_indicator.js index f24f88d60a2c..2ea104dfb8fa 100644 --- a/src/ui/public/chrome/__tests__/kbn_loading_indicator.js +++ b/src/ui/public/chrome/__tests__/kbn_loading_indicator.js @@ -16,7 +16,7 @@ describe('kbnLoadingIndicator', function () { $rootScope.chrome = { httpActive: (hasActiveConnections ? [1] : []) }; - const $el = $('
'); + const $el = $(''); $rootScope.$apply(); $compile($el)($rootScope); return $el; @@ -38,10 +38,4 @@ describe('kbnLoadingIndicator', function () { const $el = compile(true); expect($el.find('.spinner.ng-hide')).to.have.length(0); }); - - it('doesn\'t modify the contents of what the elment already has', function () { - const $el = compile(); - expect($el.find('#other-content')).to.have.length(1); - }); - });