notify user that large uploads might take a while
This commit is contained in:
parent
9b76faf60f
commit
db47d2e420
@ -47,6 +47,7 @@
|
||||
<div class="dialog-content dialog-border"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type='text/mustache' class="controlsTemplate">
|
||||
<a id="logged-in-status" href="JavaScript:void(0);" class="secondary">{{text}}</a>
|
||||
</script>
|
||||
|
||||
@ -5,6 +5,7 @@ onmessage = function(message) {
|
||||
var docs = [];
|
||||
_.each(rows, function(row) {
|
||||
if (row.length == 0) return;
|
||||
postMessage(JSON.stringify({size: rows.length}));
|
||||
var doc = {};
|
||||
_.each(row.split(','), function(field, index) { doc['field' + index] = field });
|
||||
docs.push(doc);
|
||||
|
||||
@ -116,12 +116,15 @@ var costco = function() {
|
||||
};
|
||||
var worker = new Worker('script/costco-csv-worker.js');
|
||||
worker.onmessage = function(message) {
|
||||
if(JSON.parse(message.data).done) {
|
||||
message = JSON.parse(message.data);
|
||||
if(message.done) {
|
||||
util.hide('dialog');
|
||||
util.notify("Data uploaded successfully!");
|
||||
recline.initializeTable(app.offset);
|
||||
} else if (message.size) {
|
||||
util.notify("Processing " + message.size + " rows. This could take a while...", {persist: true, loader: true});
|
||||
} else {
|
||||
util.notify(message.data);
|
||||
util.notify(JSON.stringify(message));
|
||||
}
|
||||
};
|
||||
worker.postMessage(payload);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user