diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-28 16:46:19 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-28 16:46:19 -0700 |
commit | 2884e1826c8908b195422c2c422be6166a06cf79 (patch) | |
tree | 83a399a1d5f9aa674b93c12c92e407556a93f567 | |
parent | 34ebaf94125130376d44bc7c3e5cebd11c7a08c5 (diff) |
fix progress shown when multiple asset packages are downloaded
-rw-r--r-- | tools/file_packager.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py index 30f216ae..1d0ec447 100644 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -134,6 +134,11 @@ if (not force) and len(data_files) == 0: ret = ''' var Module; if (typeof Module === 'undefined') Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()'); +if (!Module.expectedDataFileDownloads) { + Module.expectedDataFileDownloads = 0; + Module.finishedDataFileDownloads = 0; +} +Module.expectedDataFileDownloads++; (function() { ''' @@ -431,12 +436,6 @@ if has_preloaded: package_uuid = uuid.uuid4(); remote_package_name = os.path.basename(Compression.compressed_name(data_target) if Compression.on else data_target) code += r''' - if (!Module.expectedDataFileDownloads) { - Module.expectedDataFileDownloads = 0; - Module.finishedDataFileDownloads = 0; - } - Module.expectedDataFileDownloads++; - var PACKAGE_PATH = window['encodeURIComponent'](window.location.pathname.toString().substring(0, window.location.pathname.toString().lastIndexOf('/')) + '/'); var PACKAGE_NAME = '%s'; var REMOTE_PACKAGE_NAME = '%s'; |