Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
add loadng messages
Browse files Browse the repository at this point in the history
  • Loading branch information
criticalbh committed May 17, 2017
1 parent 992f473 commit a7ed39d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions client/pages/home.comp.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
</ul>
</div>
<div id="globalFeed">
<span>Loading articles ...</span>
</div>
</div>

<div class="col-md-3">
<div class="sidebar">
<p>Popular Tags</p>
<div id="tagList" class="tag-list">
Loading tags ...
</div>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions client/pages/home.comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class HomeComponent extends HTMLElement {
fetch('https://conduit.productionready.io/api/articles').then(function (response) {
return response.json();
}).then(r => {
this.cleanGlobalFeed();
r.articles.forEach(article => {
this.generateArticle(article, globalFeed);
});
Expand All @@ -66,6 +67,9 @@ export class HomeComponent extends HTMLElement {
fetch('https://conduit.productionready.io/api/tags').then(function (response) {
return response.json();
}).then(r => {
while (tagList.firstChild) {
tagList.removeChild(tagList.firstChild);
}
r.tags.forEach(tag => {
const tagEl = this.createNewTagElement(tag);
tagEl.addEventListener('click', () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"scripts": {
"start": "webpack-dev-server",
"build": "webpack --config webpack.config.prod.js",
"build": "rm -rf dist && webpack --config webpack.config.prod.js",
"prod": "cp serve.js dist/serve.js && node serve.js"
},
"dependencies": {
Expand Down

0 comments on commit a7ed39d

Please sign in to comment.