Fix coding style in page_view.js

This commit is contained in:
Jonas Jenwald 2013-09-20 09:28:03 +02:00
parent cebf3c60e2
commit 2cf2eb0dfc

View File

@ -87,8 +87,9 @@ var PageView = function pageView(container, id, scale,
div.style.width = Math.floor(this.viewport.width) + 'px'; div.style.width = Math.floor(this.viewport.width) + 'px';
div.style.height = Math.floor(this.viewport.height) + 'px'; div.style.height = Math.floor(this.viewport.height) + 'px';
while (div.hasChildNodes()) while (div.hasChildNodes()) {
div.removeChild(div.lastChild); div.removeChild(div.lastChild);
}
div.removeAttribute('data-loaded'); div.removeAttribute('data-loaded');
this.annotationLayer = null; this.annotationLayer = null;
@ -121,8 +122,9 @@ var PageView = function pageView(container, id, scale,
function bindLink(link, dest) { function bindLink(link, dest) {
link.href = PDFView.getDestinationHash(dest); link.href = PDFView.getDestinationHash(dest);
link.onclick = function pageViewSetupLinksOnclick() { link.onclick = function pageViewSetupLinksOnclick() {
if (dest) if (dest) {
PDFView.navigateTo(dest); PDFView.navigateTo(dest);
}
return false; return false;
}; };
link.className = 'internalLink'; link.className = 'internalLink';
@ -445,8 +447,9 @@ var PageView = function pageView(container, id, scale,
self.stats = pdfPage.stats; self.stats = pdfPage.stats;
self.updateStats(); self.updateStats();
if (self.onAfterDraw) if (self.onAfterDraw) {
self.onAfterDraw(); self.onAfterDraw();
}
cache.push(self); cache.push(self);
@ -547,10 +550,11 @@ var PageView = function pageView(container, id, scale,
console.error(error); console.error(error);
// Tell the printEngine that rendering this canvas/page has failed. // Tell the printEngine that rendering this canvas/page has failed.
// This will make the print proces stop. // This will make the print proces stop.
if ('abort' in obj) if ('abort' in obj) {
obj.abort(); obj.abort();
else } else {
obj.done(); obj.done();
}
self.pdfPage.destroy(); self.pdfPage.destroy();
}); });
}; };