Skip to content

Commit

Permalink
[chrome] replace the active http requests spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
spalger committed Feb 11, 2016
1 parent 4e27267 commit 1bf3106
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/ui/public/chrome/directives/active_http_spinner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ul class="nav navbar-nav navbar-right navbar-timepicker" >
<li ng-show="chrome.httpActive.length" class="navbar-text hidden-xs">
<div class="spinner"></div>
</li>
</ul>
8 changes: 7 additions & 1 deletion src/ui/public/chrome/directives/append_nav_controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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(
`<!-- nav control ${control.name} -->`,
control.template
Expand Down
2 changes: 1 addition & 1 deletion src/ui/public/chrome/directives/kbn_chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<app-switcher></app-switcher>'
Expand Down

0 comments on commit 1bf3106

Please sign in to comment.