Skip to content

Commit

Permalink
refactor: pass jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanee committed May 26, 2015
1 parent f1e7d51 commit b7a2d99
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions dist/angular-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
var viewport,
pageWidthScale,
pageHeightScale,
renderContext = {};
renderContext = {},
pageRendering;

if (attrs.scale === 'page-fit' && !scale) {
viewport = page.getViewport(1);
Expand All @@ -51,7 +52,11 @@
viewport: viewport
};

page.render(renderContext);
page.render(renderContext).promise.then(function() {
if (typeof scope.onPageRender === 'function' ) {
scope.onPageRender();
}
});
});
};

Expand Down
2 changes: 1 addition & 1 deletion dist/angular-pdf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/js/directives/angular-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
var viewport,
pageWidthScale,
pageHeightScale,
renderContext = {};
renderContext = {},
pageRendering;

if (attrs.scale === 'page-fit' && !scale) {
viewport = page.getViewport(1);
Expand All @@ -51,8 +52,7 @@
viewport: viewport
};

var pageRendering = page.render(renderContext);
pageRendering.promise.then(function() {
page.render(renderContext).promise.then(function() {
if (typeof scope.onPageRender === 'function' ) {
scope.onPageRender();
}
Expand Down

0 comments on commit b7a2d99

Please sign in to comment.