Remove code duplication from test code.

This commit is contained in:
kovacsv 2017-01-14 11:10:12 +01:00
parent ccc2a07206
commit 560e4c937e

View File

@ -508,21 +508,9 @@ ImporterApp.prototype.InitTestMode = function ()
window.addEventListener ('keydown', function (event) {
var keyCode = event.which;
if (keyCode == 84 && currentTestFile < jsonContent.files.length) {
myThis.dialog.Close ();
event.preventDefault ();
JSM.ConvertURLListToJsonData (jsonContent.files[currentTestFile], {
onError : function () {
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);
}
});
myThis.dialog.Close ();
myThis.ProcessFiles (jsonContent.files[currentTestFile], true);
currentTestFile++;
}
}, false);