Permalink
Browse files

Loading indicator in read module.

  • Loading branch information...
1 parent be701ab commit dfec191b1c5c297615045f65877cfc4494443def @a-fung committed Oct 20, 2012

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -111,7 +111,7 @@ <h3 class="msg msg-Login"></h3>
<span class="mangas-breadcrumb-tag-name"></span>
</li>
</ul>
- <div class="mangas-loading">
+ <div id="mangas-loading">
</div>
<div class="mangas-pagination">
</div>
@@ -472,6 +472,8 @@ <h3 class="msg msg-ChangePassword"></h3>
<i class="icon-info-sign icon-white"></i>
</a>
</div>
+ <div id="read-loading">
+ </div>
</div>
<div class="well" id="loading-well">
<span class="msg msg-Loading"></span>
View
@@ -296,6 +296,23 @@ textarea {
opacity: 1;
}
+ #read-loading {
+ position: absolute;
+ left: 50%;
+ top: 3px;
+ width: 20px;
+ height: 20px;
+ margin-left: -10px;
+ background-image: url("../img/loading.gif");
+ background-repeat: no-repeat;
+ background-position: center center;
+ background-color: white;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+ opacity: .85;
+ }
+
#read-button-area {
a {
display: block;
@@ -57,7 +57,10 @@ protected override void OnBeforeShow()
protected override void OnShow()
{
- ChangePage(currentPage);
+ if (items.Length > 0)
+ {
+ ChangePage(currentPage);
+ }
}
[AlternateSignature]
@@ -82,11 +82,31 @@ private int CurrentPage
private Dictionary<int, MangaPage> loadedPages = new Dictionary<int, MangaPage>();
private Dictionary<int, MangaPage> insertedPages = new Dictionary<int, MangaPage>();
private Queue<MangaPage> loadQueue = new Queue<MangaPage>();
- private bool loadingPage;
private Date lastRefreshMangaArea;
private int pagesHead = 0;
private int pagesTail = 0;
+ private bool _loadingPage;
+ private bool LoadingPage
+ {
+ get
+ {
+ return _loadingPage;
+ }
+ set
+ {
+ _loadingPage = value;
+ if (value)
+ {
+ jQuery.Select("#read-loading").AddClass("fade").AddClass("in");
+ }
+ else
+ {
+ jQuery.Select("#read-loading").AddClass("fade").RemoveClass("in");
+ }
+ }
+ }
+
private int _offset;
private int Offset
{
@@ -437,7 +457,7 @@ private void LoadPage(int page)
private void LoadNextPage()
{
- if (loadingPage)
+ if (LoadingPage)
{
return;
}
@@ -448,10 +468,10 @@ private void LoadNextPage()
}
MangaPage page = loadQueue.Dequeue();
- loadingPage = true;
+ LoadingPage = true;
page.Load(delegate
{
- loadingPage = false;
+ LoadingPage = false;
LoadNextPage();
RefreshMangaArea();
});
@@ -482,7 +502,7 @@ private void UnloadAllPages()
UnloadPage(key);
}
- loadingPage = false;
+ LoadingPage = false;
}
private MangaPage GetMangaPage(int page)

0 comments on commit dfec191

Please sign in to comment.