Skip to content

Commit

Permalink
Initial implementation for loading animation and skeleton placeholder…
Browse files Browse the repository at this point in the history
…s for components on Person canvas. (CFM-205) (#76)
  • Loading branch information
arlen authored Feb 13, 2023
1 parent c5dcc23 commit 58f5c17
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
13 changes: 11 additions & 2 deletions app/templates/element/mveaJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
status: '<?= __d('field', 'datepicker.hour') ?>',
unverified: '<?= __d('field', 'unverified') ?>',
visit: '<?= __d('information', 'global.visit.link') ?>'
}
},
isLoading: true
}
},
components: {
Expand Down Expand Up @@ -121,8 +122,16 @@
<div id="<?= $htmlId ?>" class="col cm-mvea-col">
<div class="card h-100">
<div class="card-body">
<h2 class="card-title"><?= $title ?></h2>
<h2 class="card-title">
<?= $title ?>
<span v-show="isLoading" class="co-loading-mini" role="status">
<span></span><span></span><span></span>
</span>
</h2>
<div class="card-text">
<ul v-show="isLoading" class="cm-mvea fields data-list skeleton-list">
<li><span class="visually-hidden">Loading...</span></li>
</ul>
<mveas
:mveas="this.mveas"
:core="this.core"
Expand Down
5 changes: 4 additions & 1 deletion app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1506,7 +1506,7 @@ table.list-mode .read-only-link-container {
color: var(--cmg-color-gray-003);
padding: 0 0.5em;
}
/* LOADING ANIMATION */
/* LOADING ANIMATION & SKELETONS */
@keyframes loading {
0% { opacity: 0.3; }
30% { opacity: 1.0; }
Expand Down Expand Up @@ -1576,6 +1576,9 @@ table.list-mode .read-only-link-container {
.co-loading-mini span:nth-child(3) {
animation-delay: 0.4s;
}
.skeleton-list li {
height: 2.2rem;
}
/* BUTTONS */
.btn {
text-transform: uppercase;
Expand Down
3 changes: 3 additions & 0 deletions app/webroot/js/comanage/components/mvea/mvea-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export default {
return constructLanguageString(lang)
}
},
mounted() {
this.$parent.$parent.isLoading = false;
},
template: `
<!-- Names -->
<li class="field-data-container" v-if="this.core.mveaType == 'names'">
Expand Down

0 comments on commit 58f5c17

Please sign in to comment.