Browse Source

Merge pull request #396 from notmasteryet/print

Hiding sidebar, toolbar, shadows and pages that were not loaded
Andreas Gal 14 years ago
parent
commit
472fe368df
  1. 31
      web/viewer.css
  2. 2
      web/viewer.js

31
web/viewer.css

@ -210,3 +210,34 @@ canvas {
-webkit-box-shadow: 0px 2px 10px #ff0; -webkit-box-shadow: 0px 2px 10px #ff0;
} }
/* === Printed media overrides === */
@media print {
#sidebar {
display: none;
}
#controls {
display: none;
}
#viewer {
margin: 0;
padding: 0;
}
.page {
display: none;
margin: 0;
}
.page canvas {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
.page[data-loaded] {
display: block;
page-break-after: always;
}
}

2
web/viewer.js

@ -211,6 +211,7 @@ var PageView = function(container, content, id, width, height,
while (div.hasChildNodes()) while (div.hasChildNodes())
div.removeChild(div.lastChild); div.removeChild(div.lastChild);
div.removeAttribute('data-loaded');
}; };
function setupLinks(canvas, content, scale) { function setupLinks(canvas, content, scale) {
@ -259,6 +260,7 @@ var PageView = function(container, content, id, width, height,
this.content.startRendering(ctx, this.updateStats); this.content.startRendering(ctx, this.updateStats);
setupLinks(canvas, this.content, this.scale); setupLinks(canvas, this.content, this.scale);
div.setAttribute('data-loaded', true);
return true; return true;
}; };

Loading…
Cancel
Save