Skip to content

Commit ca03387

Browse files
committed
Defer loading of model provided with openFile queryString
1 parent c66f6c8 commit ca03387

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

model/modelList.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,10 @@
9696
return list.length;
9797
}
9898

99-
// ***********************************************************************************************************************
100-
// ************************************************** constructor code ***************************************************
101-
// ***********************************************************************************************************************
102-
returnObj.addNewModel();
103-
104-
// check if an openFile was provided in the querystring and if yes, try to load a model from that file
105-
if (ACS.openFile) {
99+
returnObj.loadQueryStringModel = function () {
106100
var xmlObj;
107101
var httpRequest = new XMLHttpRequest();
108-
httpRequest.onreadystatechange = function() {
102+
httpRequest.onreadystatechange = function () {
109103
if (httpRequest.readyState === XMLHttpRequest.DONE && httpRequest.status === 200) {
110104
list[0].setFilename(ACS.openFile.substring(ACS.openFile.lastIndexOf('/') + 1));
111105
xmlObj = $.parseXML(httpRequest.responseText);
@@ -121,5 +115,10 @@
121115
// has been installed in order not to confuse the enduser, who often will have no knowledge of URLs and querystrings.
122116
}
123117
}
118+
// ***********************************************************************************************************************
119+
// ************************************************** constructor code ***************************************************
120+
// ***********************************************************************************************************************
121+
returnObj.addNewModel();
122+
124123
return returnObj;
125124
}

webACS.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
clipBoard = ACS.clipBoard();
106106
view = ACS.view(modelList, clipBoard);
107107
ACS.areStatus.setModelList(modelList);
108+
if (ACS.openFile) modelList.loadQueryStringModel();
108109

109110
return returnObj;
110-
}
111+
}

0 commit comments

Comments
 (0)