Made viewer's webViewerLoad callable from outside viewer.js

To allow manual triggering when DOMContentLoaded can not be relied upon.
This commit is contained in:
Samuel Chantaraud 2014-02-27 13:45:02 -04:00
parent 4285642ec8
commit dcb174ed58

View File

@ -1592,12 +1592,12 @@ var DocumentOutlineView = function documentOutlineView(outline) {
//})(); //})();
//#endif //#endif
document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) { function webViewerLoad(evt) {
PDFView.initialize(); PDFView.initialize();
//#if (GENERIC || B2G) //#if (GENERIC || B2G)
var params = PDFView.parseQueryString(document.location.search.substring(1)); var params = PDFView.parseQueryString(document.location.search.substring(1));
var file = params.file || DEFAULT_URL; var file = 'file' in params ? params.file : DEFAULT_URL;
//#endif //#endif
//#if (FIREFOX || MOZCENTRAL) //#if (FIREFOX || MOZCENTRAL)
//var file = window.location.href.split('#')[0]; //var file = window.location.href.split('#')[0];
@ -1813,7 +1813,9 @@ document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {
//#endif //#endif
//#if !B2G && !CHROME //#if !B2G && !CHROME
PDFView.open(file, 0); if (file) {
PDFView.open(file, 0);
}
//#endif //#endif
//#if CHROME //#if CHROME
@ -1845,7 +1847,9 @@ document.addEventListener('DOMContentLoaded', function webViewerLoad(evt) {
// PDFView.open(file, 0); // PDFView.open(file, 0);
//}); //});
//#endif //#endif
}, true); }
document.addEventListener('DOMContentLoaded', webViewerLoad, true);
function updateViewarea() { function updateViewarea() {