Skip to content

Commit

Permalink
Merge pull request #1 from rashidkpc/pr/6645
Browse files Browse the repository at this point in the history
Move kbn-loading-indicator to element
  • Loading branch information
panda01 committed Mar 24, 2016
2 parents 2202f7f + e60aca3 commit 6b47ced
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/ui/public/chrome/__tests__/kbn_loading_indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('kbnLoadingIndicator', function () {
$rootScope.chrome = {
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();
$compile($el)($rootScope);
return $el;
Expand All @@ -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);
});

});
3 changes: 2 additions & 1 deletion src/ui/public/chrome/chrome.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
</div>
<!-- /Full navbar -->
</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>
8 changes: 2 additions & 6 deletions src/ui/public/chrome/directives/kbn_loading_indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
});

0 comments on commit 6b47ced

Please sign in to comment.