Remove code duplication from test code.
This commit is contained in:
parent
ccc2a07206
commit
560e4c937e
@ -508,21 +508,9 @@ ImporterApp.prototype.InitTestMode = function ()
|
|||||||
window.addEventListener ('keydown', function (event) {
|
window.addEventListener ('keydown', function (event) {
|
||||||
var keyCode = event.which;
|
var keyCode = event.which;
|
||||||
if (keyCode == 84 && currentTestFile < jsonContent.files.length) {
|
if (keyCode == 84 && currentTestFile < jsonContent.files.length) {
|
||||||
myThis.dialog.Close ();
|
|
||||||
event.preventDefault ();
|
event.preventDefault ();
|
||||||
JSM.ConvertURLListToJsonData (jsonContent.files[currentTestFile], {
|
myThis.dialog.Close ();
|
||||||
onError : function () {
|
myThis.ProcessFiles (jsonContent.files[currentTestFile], true);
|
||||||
myThis.GenerateError ('No readable file found. You can open 3ds, obj and stl files.');
|
|
||||||
return;
|
|
||||||
},
|
|
||||||
onReady : function (fileNames, jsonData) {
|
|
||||||
myThis.fileNames = fileNames;
|
|
||||||
myThis.viewer.SetJsonData (jsonData);
|
|
||||||
var menu = document.getElementById ('menu');
|
|
||||||
var progressBar = new ImporterProgressBar (menu);
|
|
||||||
myThis.JsonLoaded (progressBar);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
currentTestFile++;
|
currentTestFile++;
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user