Merge pull request #1 from rashidkpc/pr/6645
Move kbn-loading-indicator to element
This commit is contained in:
commit
6b47cedd3b
|
@ -16,7 +16,7 @@ describe('kbnLoadingIndicator', function () {
|
||||||
$rootScope.chrome = {
|
$rootScope.chrome = {
|
||||||
httpActive: (hasActiveConnections ? [1] : [])
|
httpActive: (hasActiveConnections ? [1] : [])
|
||||||
};
|
};
|
||||||
const $el = $('<div kbn-loading-indicator><div id="other-content"></div></div>');
|
const $el = $('<kbn-loading-indicator></kbn-loading-indicator>');
|
||||||
$rootScope.$apply();
|
$rootScope.$apply();
|
||||||
$compile($el)($rootScope);
|
$compile($el)($rootScope);
|
||||||
return $el;
|
return $el;
|
||||||
|
@ -38,10 +38,4 @@ describe('kbnLoadingIndicator', function () {
|
||||||
const $el = compile(true);
|
const $el = compile(true);
|
||||||
expect($el.find('.spinner.ng-hide')).to.have.length(0);
|
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);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,7 +64,8 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- /Full navbar -->
|
<!-- /Full navbar -->
|
||||||
</nav>
|
</nav>
|
||||||
<div class="application" ng-class="'tab-' + chrome.getFirstPathSegment() + ' ' + chrome.getApplicationClasses()" ng-view kbn-loading-indicator></div>
|
<kbn-loading-indicator></kbn-loading-indicator>
|
||||||
|
<div class="application" ng-class="'tab-' + chrome.getFirstPathSegment() + ' ' + chrome.getApplicationClasses()" ng-view></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,11 +7,7 @@ UiModules
|
||||||
.get('ui/kibana')
|
.get('ui/kibana')
|
||||||
.directive('kbnLoadingIndicator', function ($compile) {
|
.directive('kbnLoadingIndicator', function ($compile) {
|
||||||
return {
|
return {
|
||||||
restrict: 'AC',
|
restrict: 'E',
|
||||||
link: function (scope, $el) {
|
template: spinnerTemplate,
|
||||||
const $loadingEl = angular.element(spinnerTemplate);
|
|
||||||
$el.append($loadingEl);
|
|
||||||
$compile($loadingEl)(scope);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue