[chrome] replace the active http requests spinner
This commit is contained in:
parent
4e27267a8a
commit
1bf3106d5a
5
src/ui/public/chrome/directives/active_http_spinner.html
Normal file
5
src/ui/public/chrome/directives/active_http_spinner.html
Normal file
|
@ -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>
|
|
@ -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(
|
||||
`<!-- nav control ${control.name} -->`,
|
||||
control.template
|
||||
|
|
|
@ -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>'
|
||||
|
|
Loading…
Reference in a new issue