Add loading indicator
This commit is contained in:
parent
b936e2ec20
commit
ed7f9fbabf
5 changed files with 51 additions and 0 deletions
|
|
@ -71,6 +71,26 @@
|
|||
}
|
||||
}
|
||||
|
||||
.loading-indicator {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
|
||||
svg {
|
||||
@apply fill-base-2;
|
||||
margin: auto;
|
||||
animation: loading-indicator 0.45s infinite linear;
|
||||
|
||||
@keyframes loading-indicator {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
&.sidebar-is-opened {
|
||||
overflow: hidden;
|
||||
|
|
|
|||
11
app/controllers/application.js
Normal file
11
app/controllers/application.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ApplicationController extends Controller {
|
||||
loadingIndicatorRemover() {
|
||||
const el = document.querySelector('.loading-indicator');
|
||||
|
||||
if (el) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,12 @@
|
|||
{{content-for "head-footer"}}
|
||||
</head>
|
||||
<body>
|
||||
<div class="loading-indicator">
|
||||
<svg width="80" height="80" viewBox="0 0 24 24" role="img">
|
||||
<path d="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{{content-for "body"}}
|
||||
|
||||
<script src="{{rootURL}}assets/vendor.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
{{this.loadingIndicatorRemover}}
|
||||
|
||||
{{outlet}}
|
||||
|
||||
<ToastsContainer />
|
||||
|
|
|
|||
12
tests/unit/controllers/application-test.js
Normal file
12
tests/unit/controllers/application-test.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'meiliadmin/tests/helpers';
|
||||
|
||||
module('Unit | Controller | application', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
// TODO: Replace this with your real tests.
|
||||
test('it exists', function (assert) {
|
||||
let controller = this.owner.lookup('controller:application');
|
||||
assert.ok(controller);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue