From 62fedc3c15e6bf9bd751f8181baf11036ab9f46b Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 30 May 2014 09:59:59 +0100 Subject: Einrückung MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/index.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'js') diff --git a/js/index.js b/js/index.js index 90dde6d..8803e47 100644 --- a/js/index.js +++ b/js/index.js @@ -576,6 +576,7 @@ function addPlanAttr(fileEntry, wasdownloaded){ function downloadPdf(link){ var filename = link.substring(link.lastIndexOf("/") + 1); + // FIXME Downloads beim ersten Start erst nach Schließen der App fertig window.requestFileSystem( LocalFileSystem.PERSISTENT, 0, function(fileSystem){ @@ -587,20 +588,20 @@ function downloadPdf(link){ console.log('Datei schon heruntergeladen'); $.mobile.loading('hide'); // Loader verstecken }, - function(err){ - // Datei existiert noch nicht - dirEntry.getFile(filename, {create: true, exclusive: false}, - function(fileEntry){ - var fileTransfer = new FileTransfer(); - - fileTransfer.download( - link, - fileEntry.toURL(), - function(theFile){ - console.log('Download fertig: ' + theFile.toURL()); - addPlanAttr(theFile, true); + function(err){ + // Datei existiert noch nicht + dirEntry.getFile(filename, {create: true, exclusive: false}, + function(fileEntry){ + var fileTransfer = new FileTransfer(); + + fileTransfer.download( + link, + fileEntry.toURL(), + function(theFile){ + console.log('Download fertig: ' + theFile.toURL()); + addPlanAttr(theFile, true); + }, fail); }, fail); - }, fail); }); }, fail); }); -- cgit v1.3.1