-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added simple loading template mechanism for music route
- Loading branch information
1 parent
a41710e
commit 638b7f3
Showing
5 changed files
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class SongListComponent extends Component { | ||
@tracked currentlyLoading = false; | ||
|
||
@action | ||
async loading(transition) { | ||
this.currentlyLoading = true; | ||
|
||
transition.promise.finally(function () { | ||
this.currentlyLoading = false; | ||
}); | ||
} | ||
@tracked isLoading = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import Controller from '@ember/controller'; | ||
import { tracked } from '@glimmer/tracking'; | ||
|
||
export default class MusicController extends Controller {} | ||
export default class MusicController extends Controller { | ||
@tracked isLoading = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="loading-spinner"> | ||
{{t "general.loading"}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<h2>{{t "layout.headMusic"}}</h2> | ||
<p>{{t "sections.music.description"}}</p> | ||
<SongList @songs={{@model}} /> | ||
{{#if this.isLoading}} | ||
{{t "general.loading"}} | ||
{{else}} | ||
<SongList @songs={{@model}} /> | ||
{{/if}} |