Skip to content

Commit

Permalink
Optional height
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Makhov committed May 12, 2016
1 parent 2eb7bc2 commit 30eadb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<link rel="import" href="../pdf-element.html">

<style is="custom-style" include="demo-pages-shared-styles">
<style is="custom-style" >
.vertical-section-container {
max-width: 900px;
}
Expand All @@ -37,13 +37,15 @@
</head>

<body unresolved>

<div class="vertical-section-container centered">
<h3>PDF-element</h3>
<demo-snippet class="centered-demo">
<template>
<pdf-element src="./example.pdf"
<pdf-element src="./example.pdf"
elevation="5"
downloadable
height="900"
show-file-name
enable-text-selection></pdf-element>
</template>
Expand Down
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
this.toolbarHeight = 0;
this.title = this.toolbar.querySelector('.title');
this.enableTextSelection = el.enableTextSelection;

this.HEIGHT = el.getAttribute('height');

this.viewport = this.reader.querySelector('.pdf-viewport');

Expand Down Expand Up @@ -39,7 +39,8 @@
Reader.prototype.setSize = function(attrName, newVal) {

this.WIDTH = this.viewportOut.offsetWidth;
this.HEIGHT = this.viewportOut.offsetHeight;
if (!this.HEIGHT)
this.HEIGHT = this.viewportOut.offsetHeight;

var width = this.WIDTH,
height = this.HEIGHT;
Expand Down

0 comments on commit 30eadb6

Please sign in to comment.