From a52c07ae4415e3fc2d27a9c4ff3689d669b2f12f Mon Sep 17 00:00:00 2001 From: spalger Date: Thu, 11 Feb 2016 08:36:02 -0700 Subject: [PATCH] replace the active http requests spinner Fixes #6193 --- src/ui/public/chrome/directives/active_http_spinner.html | 5 +++++ src/ui/public/chrome/directives/append_nav_controls.js | 8 +++++++- src/ui/public/chrome/directives/kbn_chrome.js | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 src/ui/public/chrome/directives/active_http_spinner.html diff --git a/src/ui/public/chrome/directives/active_http_spinner.html b/src/ui/public/chrome/directives/active_http_spinner.html new file mode 100644 index 0000000000000..d7c9b64fbe3c6 --- /dev/null +++ b/src/ui/public/chrome/directives/active_http_spinner.html @@ -0,0 +1,5 @@ + diff --git a/src/ui/public/chrome/directives/append_nav_controls.js b/src/ui/public/chrome/directives/append_nav_controls.js index 1433ec0654428..d37b9c6fe0a74 100644 --- a/src/ui/public/chrome/directives/append_nav_controls.js +++ b/src/ui/public/chrome/directives/append_nav_controls.js @@ -2,6 +2,12 @@ import $ from 'jquery'; import chromeNavControlsRegistry from 'ui/registry/chrome_nav_controls'; import UiModules from 'ui/modules'; +import spinnerHtml from './active_http_spinner.html'; + +const spinner = { + name: 'active http requests', + template: spinnerHtml +}; export default function (chrome, internals) { @@ -13,7 +19,7 @@ export default function (chrome, internals) { const parts = [$element.html()]; const controls = Private(chromeNavControlsRegistry); - for (const control of controls.inOrder) { + for (const control of [spinner, ...controls.inOrder]) { parts.unshift( ``, control.template diff --git a/src/ui/public/chrome/directives/kbn_chrome.js b/src/ui/public/chrome/directives/kbn_chrome.js index d6e9ddeed4a43..e06b373a3c15b 100644 --- a/src/ui/public/chrome/directives/kbn_chrome.js +++ b/src/ui/public/chrome/directives/kbn_chrome.js @@ -44,7 +44,7 @@ export default function (chrome, internals) { onRouteChange(); // and some local values - $scope.httpActive = $http.pendingRequests; + chrome.httpActive = $http.pendingRequests; $scope.notifList = require('ui/notify')._notifs; $scope.appSwitcherTemplate = new ConfigTemplate({ switcher: ''