Progress bar with jquery.
This commit is contained in:
parent
597bc06a0d
commit
618505c0c7
@ -318,10 +318,8 @@ ImporterApp.prototype.GenerateMenu = function ()
|
||||
ImporterApp.prototype.GenerateError = function (errorMessage)
|
||||
{
|
||||
this.viewer.RemoveMeshes ();
|
||||
var menu = document.getElementById ('menu');
|
||||
while (menu.lastChild) {
|
||||
menu.removeChild (menu.lastChild);
|
||||
}
|
||||
var menu = $('#menu');
|
||||
menu.empty ();
|
||||
|
||||
this.dialog.Open ({
|
||||
title : 'Error',
|
||||
@ -446,14 +444,12 @@ ImporterApp.prototype.ProcessFiles = function (fileList, isUrl)
|
||||
processorFunc = JSM.ConvertURLListToJsonData;
|
||||
}
|
||||
|
||||
var menu = document.getElementById ('menu');
|
||||
while (menu.lastChild) {
|
||||
menu.removeChild (menu.lastChild);
|
||||
}
|
||||
var menu = $('#menu');
|
||||
menu.empty ();
|
||||
if (isUrl) {
|
||||
menu.innerHTML = 'Downloading files...';
|
||||
menu.html ('Downloading files...');
|
||||
} else {
|
||||
menu.innerHTML = 'Loading files...';
|
||||
menu.html ('Loading files...');
|
||||
}
|
||||
|
||||
processorFunc (userFiles, {
|
||||
@ -464,8 +460,7 @@ ImporterApp.prototype.ProcessFiles = function (fileList, isUrl)
|
||||
onReady : function (fileNames, jsonData) {
|
||||
myThis.fileNames = fileNames;
|
||||
myThis.viewer.SetJsonData (jsonData);
|
||||
|
||||
var menu = document.getElementById ('menu');
|
||||
menu.empty ();
|
||||
var progressBar = new ImporterProgressBar (menu);
|
||||
myThis.JsonLoaded (progressBar);
|
||||
}
|
||||
|
||||
@ -143,9 +143,6 @@ ExtensionButtons.prototype.GetButtonsDiv = function ()
|
||||
ImporterProgressBar = function (parent)
|
||||
{
|
||||
this.parent = parent;
|
||||
while (this.parent.lastChild) {
|
||||
this.parent.removeChild (this.parent.lastChild);
|
||||
}
|
||||
this.borderDiv = null;
|
||||
this.contentDiv = null;
|
||||
this.maxCount = null;
|
||||
@ -154,17 +151,11 @@ ImporterProgressBar = function (parent)
|
||||
|
||||
ImporterProgressBar.prototype.Init = function (maxCount)
|
||||
{
|
||||
this.borderDiv = document.createElement ('div');
|
||||
this.borderDiv.className = 'progressbarborder';
|
||||
this.borderDiv = $('<div>').addClass ('progressbarborder').appendTo (this.parent);
|
||||
this.contentDiv = $('<div>').addClass ('progressbarcontent').appendTo (this.borderDiv);
|
||||
|
||||
this.contentDiv = document.createElement ('div');
|
||||
this.contentDiv.className = 'progressbarcontent';
|
||||
|
||||
this.borderDiv.appendChild (this.contentDiv);
|
||||
this.parent.appendChild (this.borderDiv);
|
||||
|
||||
this.maxCount = maxCount;
|
||||
this.maxWidth = this.borderDiv.offsetWidth;
|
||||
this.maxWidth = this.borderDiv.width ();
|
||||
this.Step (0);
|
||||
};
|
||||
|
||||
@ -175,5 +166,5 @@ ImporterProgressBar.prototype.Step = function (count)
|
||||
if (count == this.maxCount) {
|
||||
width = this.maxWidth - 2;
|
||||
}
|
||||
this.contentDiv.style.width = width + 'px';
|
||||
this.contentDiv.width (width);
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user