summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorLeon Krause <lk@leonkrause.com>2018-03-27 11:23:38 +0200
committerLeon Krause <lk@leonkrause.com>2018-03-27 11:26:29 +0200
commitd373029382208226a55ddfc028a3261e0dc8279b (patch)
tree9431c8ddcb333aae0b30e442b73c57cdd2951b8a /platform/javascript
parent6f1bddf4b5e6716f59bcbd9a7587b6d556251ef9 (diff)
Allow custom path when using engine.js preloadFile() with URL
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/engine.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js
index d0d01b03aa..be8d04dd5e 100644
--- a/platform/javascript/engine.js
+++ b/platform/javascript/engine.js
@@ -88,7 +88,7 @@
});
}
- this.preloadFile = function(pathOrBuffer, bufferFilename) {
+ this.preloadFile = function(pathOrBuffer, destPath) {
if (pathOrBuffer instanceof ArrayBuffer) {
pathOrBuffer = new Uint8Array(pathOrBuffer);
@@ -97,14 +97,14 @@
}
if (pathOrBuffer instanceof Uint8Array) {
preloadedFiles.push({
- path: bufferFilename,
+ path: destPath,
buffer: pathOrBuffer
});
return Promise.resolve();
} else if (typeof pathOrBuffer === 'string') {
return loadPromise(pathOrBuffer, preloadProgressTracker).then(function(xhr) {
preloadedFiles.push({
- path: pathOrBuffer,
+ path: destPath || pathOrBuffer,
buffer: xhr.response
});
});