Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
add refresh animation
Browse files Browse the repository at this point in the history
  • Loading branch information
yjlintw committed Jul 21, 2017
1 parent d405aa4 commit 18cd2c2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ h2 {
@media only screen and (max-width: 768px) {
.sidebar .func-area .setting {
display: none; } }
.sidebar .func-area .setting.loading {
border: 0; }

/* SEARCH VIEW */
@media only screen and (max-width: 768px) {
Expand Down
3 changes: 3 additions & 0 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,9 @@ h2 {
@media #{$info-mobile} {
display: none;
}
&.loading {
border: 0;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "comic-reader",
"productName": "Comic Reader",
"author": "Team Comic Reader",
"version": "0.1.57-beta",
"version": "0.1.58-beta",
"description": "A quicker, smoother and cooler reading experience. The best way to read comics.",
"main": "main.js",
"devDependencies": {
Expand Down
15 changes: 14 additions & 1 deletion renderer-process/viewcontrollers/view-switch-viewcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ function bindCheckUpdate(func) {
checkUpdateFunc = func;
}

/**
* Animation
*/

function loadingAnimate(flag) {
if (flag) {
$("#tab-refresh").addClass("loading");
} else {
$("#tab-refresh").removeClass("loading");
}
}

/**
* Callback function when sidebar tab is clicked
*/
Expand Down Expand Up @@ -127,5 +139,6 @@ module.exports = {
TAB_NAME: TAB_NAME,
tabswitch: tabswitch,
bindUpdateAllUI: bindUpdateAllUI,
bindCheckUpdate: bindCheckUpdate
bindCheckUpdate: bindCheckUpdate,
loadingAnimate: loadingAnimate
}
2 changes: 2 additions & 0 deletions renderer-process/viewmodels/subscribe-viewmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function checkUpdateSingle(host, titlekey) {
*/
function checkUpdate() {
console.log("---- Start checking for updates ----")
viewswitch_viewcontroller.loadingAnimate(true);
let all_comic_data = settings.get('comic');
async.eachOf(all_comic_data, function(hostDict, host, callback1) {
async.eachOf(hostDict, function(comics, titlekey, callback2){
Expand Down Expand Up @@ -194,6 +195,7 @@ function onChaptersGrabbed(result, newest) {
*/
function onAllComicsUpdateChecked() {
console.log("---- All updates checked ----")
viewswitch_viewcontroller.loadingAnimate(false);
settings.set("comic", this.all_comic_data);

updateSubscribeUIStatus();
Expand Down

0 comments on commit 18cd2c2

Please sign in to comment.