1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +00:00

fix loading indicator

This commit is contained in:
Lu Wang 2013-11-18 20:56:07 +08:00
parent aca390cd48
commit af67d7a5dd
2 changed files with 6 additions and 5 deletions

View File

@ -73,6 +73,7 @@
animation: fadein 100ms; animation: fadein 100ms;
} }
.loading-indicator.active { .loading-indicator.active {
display: block;
-webkit-animation: swing 1.5s ease-in-out 0s infinite alternate none; -webkit-animation: swing 1.5s ease-in-out 0s infinite alternate none;
animation: swing 1.5s ease-in-out 0s infinite alternate none; animation: swing 1.5s ease-in-out 0s infinite alternate none;
} }

View File

@ -356,16 +356,16 @@ Viewer.prototype = {
if (this.pages_loading[idx]) if (this.pages_loading[idx])
return; // Page is already loading return; // Page is already loading
var new_loading_indicator = this.loading_indicator.cloneNode();
new_loading_indicator.classList.add('active');
var cur_page_ele = cur_page.page; var cur_page_ele = cur_page.page;
cur_page_ele.appendChild(new_loading_indicator);
var url = cur_page_ele.getAttribute('data-page-url'); var url = cur_page_ele.getAttribute('data-page-url');
if (url) { if (url) {
this.pages_loading[idx] = true; // set semaphore this.pages_loading[idx] = true; // set semaphore
// add a copy of the loading indicator
var new_loading_indicator = this.loading_indicator.cloneNode();
new_loading_indicator.classList.add('active');
cur_page_ele.appendChild(new_loading_indicator);
// load data // load data
{ {
var self = this; var self = this;