Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1 from intellisense/intellisense-fix-loading-indi…
Browse files Browse the repository at this point in the history
…cator-duplicate-coloning

Only add loading indicator if not already present
  • Loading branch information
intellisense committed Mar 31, 2015
2 parents 8b16612 + 9326378 commit 7bc0f78
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions share/pdf2htmlEX.js.in
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,13 @@ Viewer.prototype = {
if (url) {
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);
// add a copy of the loading indicator if not already present
var new_loading_indicator = cur_page_ele.getElementsByClassName(this.config['loading_indicator_cls'])[0];
if (typeof new_loading_indicator === 'undefined'){
new_loading_indicator = this.loading_indicator.cloneNode(true);
new_loading_indicator.classList.add('active');
cur_page_ele.appendChild(new_loading_indicator);
}

// load data
{
Expand Down

0 comments on commit 7bc0f78

Please sign in to comment.