diff --git a/bower.json b/bower.json index 1603099..36922cb 100644 --- a/bower.json +++ b/bower.json @@ -9,6 +9,6 @@ }, "dependencies": { "angular": "~1.4.3", - "pdf.js-viewer": "https://github.com/legalthings/pdf.js-viewer.git#0.2.1" + "pdf.js-viewer": "https://github.com/legalthings/pdf.js-viewer.git#~0.2.2" } } diff --git a/dist/angular-pdfjs.js b/dist/angular-pdfjs.js index 9f15e5a..9c55844 100644 --- a/dist/angular-pdfjs.js +++ b/dist/angular-pdfjs.js @@ -338,9 +338,7 @@ angular.module('pdfjs').directive('pdfjsViewer', [function () { if ($attrs.width) document.getElementById('outerContainer').style.width = $attrs.width; if ($attrs.height) document.getElementById('outerContainer').style.height = $attrs.height; - if (!PDFViewerApplication.initialized) return PDFJS.webViewerLoad($attrs.src); - - PDFViewerApplication.open($attrs.src, 0); + PDFJS.webViewerLoad($attrs.src); }); } }; diff --git a/src/angular-pdfjs.js b/src/angular-pdfjs.js index 36ddb96..7f39d9f 100644 --- a/src/angular-pdfjs.js +++ b/src/angular-pdfjs.js @@ -50,9 +50,7 @@ angular.module('pdfjs').directive('pdfjsViewer', [function () { if ($attrs.width) document.getElementById('outerContainer').style.width = $attrs.width; if ($attrs.height) document.getElementById('outerContainer').style.height = $attrs.height; - if (!PDFViewerApplication.initialized) return PDFJS.webViewerLoad($attrs.src); - - PDFViewerApplication.open($attrs.src, 0); + PDFJS.webViewerLoad($attrs.src); }); } };