Commit 42823a49 authored by Robert Knight's avatar Robert Knight

Remove redundant markup wrapping spinner and adjust positioning

 - Remove a semantically incorrect `<button>` wrapping the loading
   spinner and a redundant wrapping `<span>`.
 - Vertically center the spinner by adding a wrapper `<div>` in the
   spinner component itself, so that there is less of a visual shift
   when switching between displaying the loading indicator and the
   search bar.
 - Add a meaningful title attribute to the spinner. Properly indicating
   when the sidebar's content is changing/being loaded to ATs requires
   additional work which is not tackled here.
parent fb4c1efe
...@@ -10,9 +10,11 @@ module.exports = { ...@@ -10,9 +10,11 @@ module.exports = {
controller: SpinnerController, controller: SpinnerController,
controllerAs: 'vm', controllerAs: 'vm',
template: ` template: `
<span class="spinner"> <div class="spinner__container">
<span><span> <span class="spinner">
</span></span> <span><span>
</span> </span></span>
</span>
</div>
`, `,
}; };
...@@ -10,7 +10,5 @@ ...@@ -10,7 +10,5 @@
<button type="button" class="simple-search-icon top-bar__btn" ng-hide="vm.loading"> <button type="button" class="simple-search-icon top-bar__btn" ng-hide="vm.loading">
<i class="h-icon-search"></i> <i class="h-icon-search"></i>
</button> </button>
<button type="button" class="simple-search-icon btn btn-clean" ng-show="vm.loading" disabled> <spinner class="top-bar__btn" ng-show="vm.loading" title="Loading…"></spinner>
<span class="btn-icon"><spinner></spinner></span>
</button>
</form> </form>
...@@ -15,6 +15,14 @@ $part-height: 3 * $part-width; ...@@ -15,6 +15,14 @@ $part-height: 3 * $part-width;
to { transform: rotate(1turn); } to { transform: rotate(1turn); }
} }
// Container which centers the spinner vertically.
.spinner__container {
display: flex;
flex-direction: column;
align-items: center;
}
// The actual spinner itself.
.spinner { .spinner {
position: relative; position: relative;
display: inline-block; display: inline-block;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment