commit 81c9e484975c64bf219c7bc833ec17d18f32586b
parent d08825f83642944f20a2e6b3e08357f09b4661d8
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 25 Feb 2017 21:51:20 +0300
[tracks control] show spinner when loading tracks from disk
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -46,8 +46,8 @@ L.Control.TrackList = L.Control.extend({
this.tracks = ko.observableArray();
this.url = ko.observable('');
this.readingFiles = ko.observable(false);
- this.readProgressRange = ko.observable(10);
- this.readProgressDone = ko.observable(2);
+ this.readProgressRange = ko.observable();
+ this.readProgressDone = ko.observable();
this._lastTrackColor = 0;
this.trackListHeight = ko.observable(0);
},
@@ -191,6 +191,10 @@ L.Control.TrackList = L.Control.extend({
},
loadFilesFromFilesObject: function(files) {
+ this.readProgressDone(undefined);
+ this.readProgressRange(1);
+ this.readingFiles(true);
+
readFiles(files).then(function(fileDataArray) {
var geodataArray = fileDataArray.map(function(fileData) {
return parseGeoFile(fileData.filename, fileData.data);