summaryrefslogtreecommitdiff
path: root/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/index.js')
-rw-r--r--js/index.js25
1 files changed, 13 insertions, 12 deletions
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();
+ 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);
+ fileTransfer.download(
+ link,
+ fileEntry.toURL(),
+ function(theFile){
+ console.log('Download fertig: ' + theFile.toURL());
+ addPlanAttr(theFile, true);
+ }, fail);
}, fail);
- }, fail);
});
}, fail);
});