Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Search() {
- var self = this;
- //many different items set
- self.totalSize = ko.observable(total);
- self.uploadedSize = ko.observable(uploaded);
- }
- var uploadProgress;
- var total = 100;
- var uploaded = 0;
- function runUploadProgress() {
- uploadProgress = setInterval(function () {
- callWebApi({
- api: webapi.getUploadProgress,
- data: null,
- cache: false,
- success: function (json) {
- total = json.TotalBytes;
- uploaded = json.TransferedBytes;
- console.log(total + " - " + uploaded);
- }
- });
- if (total == uploaded) {
- stopUploadProgress();
- }
- }, 1000);
- return true;
- }
- function stopUploadProgress() {
- clearInterval(uploadProgress);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement